Home

Awesome

FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age

The paper: https://openaccess.thecvf.com/content/WACV2021/papers/Karkkainen_FairFace_Face_Attribute_Dataset_for_Balanced_Race_Gender_and_Age_WACV_2021_paper.pdf

Karkkainen, K., & Joo, J. (2021). FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age for Bias Measurement and Mitigation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (pp. 1548-1558).

If you use our dataset or model in your paper, please cite:

 @inproceedings{karkkainenfairface,
  title={FairFace: Face Attribute Dataset for Balanced Race, Gender, and Age for Bias Measurement and Mitigation},
  author={Karkkainen, Kimmo and Joo, Jungseock},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  year={2021},
  pages={1548--1558}
}

Examples of FairFace Prediction

Instructions to use FairFace

Run script predict.py

Run the predict.py script and provide the csv path (described in the section above).

python3 predict.py --csv "NAME_OF_CSV"

After download this repository, you can run python3 predict.py --csv test_imgs.csv, the results will be available at detected_faces (in case dlib detect multiple faces in one image, we save them here) and test_outputs.csv.

Results

The results will be saved at "test_outputs.csv" (located in the same folder as predict.py, see sample here

UPDATES:

Run script predict_bbox.py

same commands as predict.py, the output csv will have additional column "bbox" which is the bounding box of detected face.

python3 predict_bbox.py --csv "NAME_OF_CSV"
output file documentation

indices to type

Data

Images (train + validation set): Padding=0.25, Padding=1.25

We used dlib's get_face_chip() to crop and align faces with padding = 0.25 in the main experiments (less margin) and padding = 1.25 for the bias measument experiment for commercial APIs. Labels: Train, Validation

License: CC BY 4.0

Notes

The models and scripts were tested on a device with 8Gb GPU, it takes under 2 seconds to predict the 5 images in the test folder.