This is the official github repository to the paper : https://dl.acm.org/citation.cfm?id=3357242
This repository is for the gender/sex detection/classification on faces/persons within art images (paintings, sculptures, art-works). Important things to note :
- Run
pip install -r requirements.txt
. - If you are using a GPU, check/edit the
requirements.txt
file to installtensorflow-gpu
instead oftensorflow
- Install
cvlib
:pip install --upgrade cvlib
- Before running train and test, make sure you have downloaded and placed the following files as follows:
a.cfg/yolov3.cfg
b.model-weights/yolov3.weights
- The data directories should be structured as :
data
├── train
│ ├── class0
│ ├── class1
├── test
│ ├── class0
│ ├── class1
- There is one training script to generate all the models :
train.py
.- To generate model A and B:
python train.py -d <path_to_dataset>
- To generate model C:
python train.py -d <path_to_dataset> -f True -mp <path_to_styled_model (model B)>
- After the training, check if the appropriate models are saved in the respective folders (self-explanatory from the code)
- Testing the model on random folder of images. Run
python test.py --testdir <path_to_testdir> --preddir <path_to_save_predictions> --model <path_to_trained_model>
- The cams folder contains
keras_cam.py
. You can run it by using :
python keras_cam.py -m <path_to_trained_model> -t <path_to_testdir> -s <path_to_savedir>
This repo is adapted from the github repo : https://github.com/arunponnusamy/gender-detection-keras. The authors would like to thank Arun Ponnusamy for his amazing work and sharing the code to build and continue working together without "rediscovering the wheel".