There are some folders which should be downloaded in order to get different weights or testing images. The required folders are listed below and they can be found in here.
- data/
- Datasets/
- models/
- pretrained_models/
- test_images/
Some scripts are built in python notebook format in order to ease some functionalities.
-
split_data.ipynb --> By providing the path of the desired dataset, it split it into a training set (70%) and a test set (30%).
-
Dataset_to_db.ipynb --> By providing the path of the desired dataset (or part of it, as for instance the training set or the test set folders), it creates a .mat database with the desired structure of the model.
Different functionalities are implemented in the repository by using different models as well:
- train.py
It is stored in the age_gender
folder and it is used to train a model from scratch, re-train it,
fine tune it, or compute transfer learning by making the model learn from extended new data.
- The weights are initialized from the model trained from scratch with IMDB dataset (https://github.com/yu4u/age-gender-estimation/releases/download/v0.5/weights.18-4.06.hdf5)
but it can be changed.
- Check the args before training.
```
python3 train.py --input ../data/imdb_db.mat
```
- evaluate_test_results.py
It can be used to evaluate the metrics accuracy
and mean average error
.
- Test on test_set_db.mat or wiki_db.mat amongst others.
```
python3 evaluate_test_results.py
```
- predict_multiple_faces_files.py
It can be used to predict images with multiple faces on them. It predicts everyone’s age and gender (race and feelings will be implemented in the future).
- It will generate a .png picture with a resume of the results as well as a folder inside
`output_cropped_Images` with all the cropped faces individually predicted.
```
python3 predict_multiple_faces_files.py
```
- predict_emotion_from_file.py
It can be used to predict an emotion from an image file.
- detect_crowd_from_files.py
It can be used to estimate crowds on image files.
-
FaceNet
-
Tiny Faces