Code Monkey home page Code Monkey logo

face_rating's Introduction

Predicting Attractiveness using Computer Vision

Traditional Machine Learning Approach

Feature Generation

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.

Example of extracting facial features:

Dimensionality Reduction, ML Models, and Evaluation

python trainModel -model linear_model -featuredim 20

The -featuredim argument specifies the number of components chosen by PCA which are how many dimensions to be reduced.

After PCA, the -model argument is used to indicate the traditional machine learning models including Support Vector Machines (svm), Random Forests (rf), and Gaussian Process Regression (gpr). Checkout the source to change hyperparameters and other options.

Applying Pearson Correlation for result analysis with learner's prediction. For example, figure below shows PC for evaluation of Linear Regression:

Deep Learning Approach:

Details of the implementation can be found in the paper SCUT-FBP: A Benchmark Dataset for Facial Beauty Perception, the result of the creation and research on the dataset.

Model:

Network architecture of our CNN for facial beauty prediction:

Results + Example Usage:

Sample visualized results from the prediction of models for audiences to compare. The blue block represents the human's rating and the green block represents the model's rating

These pictures are celebrities in Vietnamese showbiz community and how their facial beauty were rated by our model.

What's included

face-rating/
├── data/
│   ├── ratings.txt
│   ├── landmarks.txt
│   ├── features_ALL.txt
├── source/
|   ├── machine_learning/    
│       ├── generateFeatures.py
│       ├── trainModel.py
│       ├── cross_validation.py
|   ├── deep_learning/    
│       ├── build_model.py
│       ├── utils.py
│       ├── face_rating.ipynb
|   ├── deeplearning_result.ipynb
|   ├── traditional_result.ipynb

Requirements

  • Python 2.7
  • numpy
  • pandas
  • scikit-learn
  • keras
  • tensorflow

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

face_rating's People

Contributors

huytu7 avatar avisingh599 avatar muddlebee avatar bryant1410 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.