This repository contains a source code of a deep learning network built with TensorFlow and Keras to classify gender and estimate age.
UTKFace. Large Scale Face Dataset
- Download the file containing Aligned&Cropped Faces archive. The repository contains 23,708 images with annotations encoded in the filename. All images have 200*200 px resolution.
- Unpack the contents into the
./src/all_images
folder.
- Create and activate a virtual environment.
- Install project dependencies with
pip install -r requirements.txt
- Run the
start.py
file. - When running for the first time, select option 1 to split the images into train, validation and test subfolders. There is no need to repeat this operation every time.
- The main menu includes an option to check if your system supports GPU training.
- A pre-trained model is included in the
/.output/models
folder. Feel free to overwrite or delete it.
The file history/age_gender_model.csv
contains the training history.
Run test the model
option from main menu to load a few images and predict age and gender.
Tune down the batch_size
hyperparameter if your GPU runs out of memory.
Tensorflow version that currently supports GPU with the latest CUDA / CUDNN.
pip install tf-nightly-gpu
You might require to install the Graphviz plotting library.
If you encounter an issue with plotting in your IDE, refer to this [Stack Overflow answer](Graphvis issue with plotting](https://stackoverflow.com/a/62611005/6666457)
dot -c