Giter Club home page Giter Club logo

age-and-gender's Introduction

同时识别年龄与性别

基于PyTorch 实现多任务学习,在同时识别年龄与性别。

数据集

IMDB-WIKI 数据集,460,723张图片。

image

这里为简洁只使用 IMDB 数据集。

年龄分布:

460723张照片为平衡每个年龄最多只保存5000张,清洗后得到163065张,按年龄分布作图:

image

用法

数据预处理

提取163065张图片:

$ python pre_process.py

训练

$ python train.py

准确度比较

# 图片大小 网络 性别准确度(验证集) 年龄MAE(验证集) 年龄损失函数 批量大小 Loss 年龄权重
1 112x112 ResNet-18 90.756% 5.710 回归(L1Loss) 32 0.9757 0.1
2 224x224 ResNet-18 90.887% 5.694 回归(L1Loss) 32 0.9719 0.1
3 112x112 ResNet-18 90.140% 5.986 回归(L2Loss) 32 1.121 0.01
4 224x224 ResNet-18 90.064% 8.475 分类(交叉熵) 32 TBD TBD
5 224x224 ResNet-50 90.034% TBD 分类(交叉熵) 32 TBD TBD

Demo

下载预训练的模型 Link,执行:

$ python demo.py

效果图如下:

原图 校准 识别 标注
image image 性别:女, 年龄:29 性别:女, 年龄:24
image image 性别:女, 年龄:29 性别:男, 年龄:26
image image 性别:男, 年龄:34 性别:男, 年龄:49
image image 性别:女, 年龄:29 性别:女, 年龄:29
image image 性别:男, 年龄:36 性别:女, 年龄:23
image image 性别:男, 年龄:29 性别:男, 年龄:15
image image 性别:男, 年龄:34 性别:男, 年龄:32
image image 性别:男, 年龄:42 性别:男, 年龄:42
image image 性别:男, 年龄:36 性别:女, 年龄:31
image image 性别:男, 年龄:39 性别:男, 年龄:59

age-and-gender's People

Contributors

foamliu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.