GithubHelp home page GithubHelp logo

playif / caffe-face Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ydwen/caffe-face

0.0 2.0 0.0 49.1 MB

This branch is developed for deep face recognition

Home Page: https://github.com/ydwen/caffe-face

License: Other

CMake 2.76% Makefile 0.71% Shell 0.34% MATLAB 0.94% C++ 79.62% Cuda 5.69% M 0.01% Python 8.31% Protocol Buffer 1.63%

caffe-face's Introduction

Deep Face Recognition with Caffe Implementation

This branch is developed for deep face recognition, the related paper is as follows.

A Discriminative Feature Learning Approach for Deep Face Recognition[C]
Yandong Wen, Kaipeng Zhang, Zhifeng Li*, Yu Qiao
European Conference on Computer Vision. Springer International Publishing, 2016: 499-515.

Updates

  • Oct 13, 2016
    • A demo for extracting deep feature by the given model is provided.
  • Oct 12, 2016
  • Otc 9, 2016
    • The code and training prototxt for our ECCV16 paper are released.
    • If you train our Network on CAISA-WebFace, the expected verification performance of SINGLE MODEL on LFW should be ~99%.

Files

  • Original Caffe library
  • Center Loss
    • src/caffe/proto/caffe.proto
    • include/caffe/layers/center_loss_layer.hpp
    • src/caffe/layers/center_loss_layer.cpp
    • src/caffe/layers/center_loss_layer.cu
  • face_example
    • face_example/data/
    • face_example/face_snapshot/
    • face_example/face_train_test.prototxt
    • face_example/face_solver.prototxt
    • face_example/face_deploy.prototxt
    • face_example/extractDeepFeature.m
  • mnist_example
    • mnist_example/data/
    • mnist_example/face_snapshot/
    • mnist_example/mnist_train_test.prototxt
    • mnist_example/mnist_solver.prototxt
    • mnist_example/mnist_deploy.prototxt

Train_Model

  1. The Installation completely the same as Caffe. Please follow the installation instructions. Make sure you have correctly installed before using our code.

  2. Download the face dataset for training, e.g. CAISA-WebFace, VGG-Face, MS-Celeb-1M, MegaFace.

  3. Preprocess the training face images, including detection, alignment, etc. Here we strongly recommend MTCNN, which is an effective and efficient open-source tool for face detection and alignment.

  4. Creat list for training set and validation set. Place them in face_example/data/

  5. Specify your data source for train & val

     layer {
       name: "data"
       type: "ImageData"
       top: "data"
       top: "label"
       image_data_param {
         source: "face_example/data/###your_list###"
       }
     }
    
  6. Specify the number of subject in FC6 layer

     layer {
       name: "fc6"
       type: "InnerProduct"
       bottom: "fc5"
       top: "fc6"
       inner_product_param {
         num_output: ##number##
       }
     }
    
  7. Specify the loss weight and the number of subject in center loss layer

     layer {
       name: "center_loss"
       type: "CenterLoss"
       bottom: "fc5"
       bottom: "label"
       top: "center_loss"
       loss_weight: ##weight##
       center_loss_param {
         num_output: ##number##
       }
     }
    
  8. Train model

     cd $CAFFE-FACE_ROOT
     ./build/tools/caffe train -solver face_example/face_solver.prototxt -gpu X,Y
    

Extract_DeepFeature

  1. Compile matcaffe by make matcaffe

  2. Specify the correspinding paths in face_example/extractDeepFeature.m

     addpath('path_to_matCaffe/matlab');
     model = 'path_to_deploy/face_deploy.prototxt';
     weights = 'path_to_model/face_model.caffemodel';
     image = imread('path_to_image/Jennifer_Aniston_0016.jpg');
    
  3. Run extractDeepFeature.m in Matlab

Contact

Citation

You are encouraged to cite the following paper if it helps your research.

@inproceedings{wen2016discriminative,
  title={A Discriminative Feature Learning Approach for Deep Face Recognition},
  author={Wen, Yandong and Zhang, Kaipeng and Li, Zhifeng and Qiao, Yu},
  booktitle={European Conference on Computer Vision},
  pages={499--515},
  year={2016},
  organization={Springer}
}

License

Copyright (c) Yandong Wen

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


README_Caffe

Caffe

Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by the Berkeley Vision and Learning Center (BVLC) and community contributors.

Check out the project site for all the details like

and step-by-step examples.

Join the chat at https://gitter.im/BVLC/caffe

Please join the caffe-users group or gitter chat to ask questions and talk about methods and models. Framework development discussions and thorough bug reports are collected on Issues.

Happy brewing!

License and Citation

Caffe is released under the BSD 2-Clause license. The BVLC reference models are released for unrestricted use.

Please cite Caffe in your publications if it helps your research:

@article{jia2014caffe,
  Author = {Jia, Yangqing and Shelhamer, Evan and Donahue, Jeff and Karayev, Sergey and Long, Jonathan and Girshick, Ross and Guadarrama, Sergio and Darrell, Trevor},
  Journal = {arXiv preprint arXiv:1408.5093},
  Title = {Caffe: Convolutional Architecture for Fast Feature Embedding},
  Year = {2014}
}

caffe-face's People

Watchers

 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.