/age-estimation

Keras implementation of a CNN network for age estimation.

Primary LanguagePythonMIT LicenseMIT

Age Estimation

MIT License

Keras implementation of a CNN network for age estimation.

Requirement

  • Python 3.9
  • pipenv

Development

Installation

$ pipenv install --dev

Code check & format

# code check
$ pipenv run lint && pipenv run mypy

# code format
$ pipenv run format

Usage

You need to download UTKFace and place the data in data directory.

And then, you can run this application from src/main.py.

$ pipenv run python src/main.py --train

Please refer to the help for more detailed usage.

$ pipenv run python src/main.py --help
usage: main.py [-h] [-r] [-c]

optional arguments:
  -h, --help   show this help message and exit
  -t, --train           学習
  -e, --estimate        推定

Run on docker

After downloading the dataset, execute the following command.

# build docker image
$ docker build -t age-estimation .

# train
$ docker run --gpus=all \
  -v /home/abe/age-estimation/data:/app/data \
  -v /home/abe/age-estimation/ckpt:/app/ckpt \
  -v /home/abe/age-estimation/analysis:/app/analysis \
  -it age-estimation python src/main.py --train

# estimate & make heatmap
$ docker run --gpus=all \
  -v /home/abe/age-estimation/data:/app/data \
  -v /home/abe/age-estimation/ckpt:/app/ckpt \
  -v /home/abe/age-estimation/analysis:/app/analysis \
  -it age-estimation python src/main.py --estimate