###Predicting Attractiveness using Computer Vision This is the companion code of my blog post.
The features computation part of the pipeline requires the location of facial landmars of the input images. These landmarks can be generated by the CLM-framework. I have already included the landmarks localized using this framework in the data directory of this repo, and you can directly work with them.
face-rating/
├── data/
│ ├── ratings.txt
│ ├── landmarks.txt
│ ├── features_ALL.txt
├── source/
│ ├── generateFeatures.py
│ └── trainModel.py
│ └── cross_validation.py
└── results/
├── cross_valid_predictions_knn.txt
├── cross_valid_predictions_gpr.txt
├── cross_valid_predictions_linear.txt
├── cross_valid_predictions_rf.txt
└── cross_valid_predictions_svm.txt
###Example Usage
python trainModel -model linear_model -featuredim 20
The -featuredim
argument specifies the number of components chosen by PCA. Other supported models are Support Vector Machines (svm), Random Forests (rf), and Gaussian Process Regression (gpr). Checkout the source to change hyperparameters and other options.
###Requirements
- Python 2.7
- Numpy
- scikit-learn
###Installing scikit-learn Visit the official installation page for instructions.
###Dataset
The SCUT-FBP dataset has been used. Please cite their research if you happen to use this dataset. The facial landmarks computer on this particular dataset are available in the data/
directory.
###License MIT