Dự án này đã lâu không có cập nhật mới nên không còn hiển thị trên trang chủ, danh mục hay kết quả tìm kiếm — dữ liệu vẫn được giữ nguyên và trang này vẫn xem được bình thường.
RepositoryPython
StevenBanama

StevenBanama/C3AE

C3AE implement

86sao
15fork
15issue
0lượt xem

C3AE

This is a unofficial keras implements of c3ae for age estimation. welcome to discuss ~

--------[result]-----------------

Update History:

  • 2019-9 C3AE org
  • 2020-7 transfer to tensorflow2.1 and exposing gender branch.
    • 1.add gender prediction
    • 2.change neck
    • 3.add Mish6, GeM, Smooth label and so on.
    • 4.add utk, afad, asia dataset
    • 5.add tflite freezing
  • 2020-8 fixed bugs and add fixed-precision model
      1. remove nan weights (it may case predict as unpredict)
      1. add -fp16

Part1 age branch

sourceversionIMDB(mae)WIKI(mae)extra changemodel
from papper--6.576.44----
our implementc3ae-v846.776.74change kl to focal loss without se_netmodel/imdb_focal_loss_c3ae_v84.h5
our implement v2c3ae-v896.58--SE_NET + focal_lossmodel/c3ae_imdb_v89.h5
our implement v3c3ae-v906.51--white norm + SE_NET + focal_lossmail to geekpeakspar@gmail.com

Part2 add gender branch

Triple-Boxes show much influence with different dataset, meanwhile the distribution plays an important role.

sourceversionasiautkafadmodel
our implement v4asiaage: 5.83 gender 0.955----./model/c3ae_model_v2_117_5.830443-0.955
our implement v4asia+utk--age: 5.2 gender 0.967--./model/c3ae_model_v2_91_5.681206-0.949
our implement v4asia+utk+afadage: 5.9 gender 0.9234age: 5.789 gender: 0.9491age: 3.61 gender: 0.9827./model/c3ae_model_v2_151_4.301724-0.962
our implement v4fp16+white-norm asia+utk+afadage: 6.0 gender 0.97age: 5.6 gender: 0.942age: 3.72 gender: 0.987./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973

cation: Gender annotaion of utk is opposite to wiki/imdb/asia.

**You can change weights of loss to improve age mae, [1, 20, 20].

python nets/C3AE_expand.py --white -se --source "afad" -gpu -m "fp16_white_se" -p ./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973 -fp16 -test

structs

  • assets
  • dataset (you`d better put dataset into this dir.)
  • detect (MTCNN and align)
  • download.sh (bash script of downloading dataset)
  • model (pretrain model will be here)
  • nets (all tainging code)
    • C3AE.py
  • preproccessing (preprocess dataset), which contains "wiki" "imdb" "afad" "asia" "utk"

Pretrain model(a temp model)

all trainned model saved in dir named "model"

required enviroments:

numpy, tensorflow(2.1), pandas, feather, opencv, python=3.6.5

pip install -r requirements2.1.txt

numpy, tensorflow(1.8), pandas, feather, opencv, python=2.7

pip install -r requirements.txt

test

age and gender branch(only for py3 and tensorflow2+)

  • for image

    python nets/test.py -g -white -se -i assets/timg.jpg -m ./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973

  • for video

    python nets/test.py -g -white -v -se -m ./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973

age branch

  • for image

    python nets/test.py -se -i assets/timg.jpg -m model/c3ae_imdb_v89.h5

  • for video

    python nets/test.py -v -se -m model/c3ae_imdb_v89.h5

Preparation Datasets

download imdb/wiki dataset and then extract those data to the "./dataset/"
download wiki download imdb download asia download utk download afad

Preprocess:

>>> python preproccessing/dataset_proc.py -i ./dataset/wiki_crop --source wiki
>>> python preproccessing/dataset_proc.py -i ./dataset/imdb_crop --source imdb
>>> python preproccessing/dataset_proc.py -i ./dataset/AFAD-Full --source afad 

training:

plain net
>>> python C3AE.py -gpu -p c3ae_v16.h5 -s c3ae_v16.h5 --source imdb -w 10
with se-net and white-norm (better result)
>>> python C3AE.py -gpu -p c3ae_v16.h5 -s c3ae_v16.h5 --source imdb -w 10 -white -se
for gender and age prediction:
>>> python nets/C3AE_expand.py -se -white --source "afad" -gpu -fp16 -p ./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973 

freeze tflite

python nets/C3AE_expand.py -se -white --source "asia" -gpu -fp16 -p ./model/c3ae_model_v2_fp16_white_se_132_4.208622-0.973 -fz

DETECT:

[mtcnn] (https://github.com/YYuanAnyVision/mxnet_mtcnn_face_detection): detect\align\random erasing
trible box

net struct

 params  plain_model

Q&A:

  • only 10 bins in paper: why we got 12 category: we can split it as "[0, 10, ... 110 ]" by two points!\
  • Conv5 1 * 1 * 32, has 1056 params, which mean 32 * 32 + 32. It contains a conv(1 * 1 * 32) with bias
  • feat: change [4 * 4 * 32] to [12] with 6156 params.As far as known, it may be compose of conv(6144+12) ,pooling and softmax.
  • the distribution of imdb and wiki are unbalanced, that`s why change the KL loss to focal loss
  • gender prediction: detail in nets/C3AE_expand.py

To-Do:

- 1.anchor free boundbox
- 2.add another new feathers

Reference

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositoryJupyter Notebook
tsuirak/deeplearning.ai

该存储库包含由deeplearning.ai提供的相关课程的个人的笔记和实现代码。

364
Feb 1, 2023
Modelsentence-similarity
sentence-transformers/all-MiniLM-L6-v2

all-MiniLM-L6-v2 This is a sentence-transformers(https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search. Usage (Sentence-Transformers) Using t...

♥0
190.2M
Jun 1, 2026
RepositoryTypeScript
firecrawl/firecrawl

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

195.6k
Oct 26, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Feb 15, 2026
RepositoryPython
deepinsight/insightface

State-of-the-art 2D and 3D Face Analysis Project

30.0k
Oct 19, 2026
RepositoryPython
WZMIAOMIAO/deep-learning-for-image-processing

deep learning for image processing including classification and object-detection etc.

26.4k
Jan 1, 2026
RepositoryPython
lyhue1991/eat_tensorflow2_in_30_days

Tensorflow2.0 🍎🍊 is delicious, just eat it! 😋😋

9.9k
Sep 22, 2022
RepositoryPython
lyhue1991/eat_tensorflow2_in_30_days

Tensorflow2.0 🍎🍊 is delicious, just eat it! 😋😋

9.9k
Sep 22, 2022
RepositoryPython
TensorSpeech/TensorFlowTTS

:stuck_out_tongue_closed_eyes: TensorFlowTTS: Real-Time State-of-the-art Speech Synthesis for Tensorflow 2 (supported including English, French, Korean, Chinese, German and Easy to adapt for other languages)

4.0k
Jul 5, 2024