Keras implementation of a CNN network for age estimation.
- Python 3.9
- pipenv
$ pipenv install --dev
# code check
$ pipenv run lint && pipenv run mypy
# code format
$ pipenv run format
You need to download UTKFace and place the data in data
directory.
And then, you need to copy resources/application-sample.yml
to resources/application.yml
.
This file is application preferences, so please rewrite it if necessary.
You can run this application from pipenv.
$ pipenv run start --train
Please refer to the help for more detailed usage.
$ pipenv run start --help
usage: main.py [-h] [-r] [-c]
optional arguments:
-h, --help show this help message and exit
-t, --train 学習
-e, --estimate 年齢推定
-l, --log ログ分析
After downloading the dataset, execute the following command.
# build docker image
$ docker build -t age-gender-estimation .
# train
$ docker run --gpus=all \
-v $HOME/age-gender-estimation/resources:/app/resources \
-v $HOME/age-gender-estimation/log:/app/log \
-it age-gender-estimation python main.py --train
# estimate & export heatmap
$ docker run --gpus=all \
-v $HOME/age-gender-estimation/resources:/app/resources \
-v $HOME/age-gender-estimation/log:/app/log \
-v $HOME/age-gender-estimation/heatmap:/app/heatmap \
-it age-gender-estimation python main.py --estimation