Giter Site home page Giter Site logo

rojunlin / r-3cnn Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 3.0 24.01 MB

Regression Guided by Relative Ranking Using Convolutional Neural Network (R^3 CNN) for Facial Beauty Prediction

License: Other

Python 9.34% CMake 2.63% C++ 79.36% Shell 0.42% Makefile 0.64% Cuda 6.75% MATLAB 0.86%

r-3cnn's Introduction

R3CNN: Regression Guided by Relative Ranking Using Convolutional Neural Network for Facial Beauty Prediction

R3CNN is a general CNN architecture to integrate the relative ranking of faces in terms of aesthetics to improve the performance of facial beauty prediction.

Requirements

  • Caffe (compiled with pycaffe)
  • python
  • numpy
  • matplotlib
  • skimage

Installation

  • Build Caffe

    make all -j16
    make test
    make pycaffe
    
  • Add the python directory into the environment variables

    • Open bash file: sudo gedit ~/.bashrc
    • Add the following setence into the file: export PYTHONPATH=brl/caffe/python:$PYTHONPATH
    • Update the environment variable: source ~/.bashrc

Preparation

  • Dataset download:

    Our method is trained and verified on SCUT-FBP5500 benchmark dataset. The facial images should be put under examples/data/faces, where train and test set have been already provided.

  • Image pairs generation:

    cd examples/data/
    python create_pair.py
    
  • Mean file computation:

    sh mean.sh
    

Training

  • First stage: conventional training for ResNeXt-based regression model, using pretrained model on ImageNet (download link: https://pan.baidu.com/s/12AtCeQYuYDZtUd9jZPIo1w password: enfc):

    cd examples/first_stage
    sh train.sh
    
  • Second stage:

    • Rename the caffemodel obtained in the first stage as the format of 'R2Net_hinge_iter_0.caffemodel' (download link: https://pan.baidu.com/s/1Dx3H108gCvJ71fcVg3BzjQ password: p3jk) ;
    • Put 'R2Net_hinge_iter_0.caffemodel' under examples/hinge_loss/snapshot/1;
    • Use hinge loss to train R3CNN:
      cd examples/hinge_loss
      sh train.sh
      
    • If using LSEP loss to train R3CNN, you can run examples/lsep_loss/train.sh๏ผ›
    • If using other backbone networks (i.e., AlexNet and ResNet-18) to train R3CNN, you can run the codes in ./examples/other_networks;

Validation

Citation

Please cite our paper:

@article{lin2019regression,
  title={Regression guided by relative ranking using convolutional neural network (R3CNN) for facial beauty prediction},
  author={Lin, Luojun and Liang, Lingyu and Jin, Lianwen},
  journal={IEEE Transactions on Affective Computing},
  year={2019},
  publisher={IEEE}
}

Contact Us

For any questions, please feel free to contact Dr. Lin ([email protected]) or Prof. Jin ([email protected]).

Copyright

This code is free to the academic community for research purpose only. For commercial purpose usage, please contact Prof. Lianwen Jin ([email protected]).

r-3cnn's People

Contributors

rojunlin avatar

Stargazers

 avatar Egbert Wong avatar  avatar Jared Van Bortel avatar  avatar  avatar Yachun avatar menorki manil avatar wang xianji avatar  avatar  avatar bygreencn avatar Lawrence avatar Deep Learning and Vision Computing Lab, SCUT avatar  avatar

Watchers

James Cloos avatar  avatar

r-3cnn's Issues

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.