Giter Club home page Giter Club logo

vgg-face-fine-tune's Introduction

what content does this project contain

  1. face detection and alignment Alt text

  2. face verification predictions Alt text

  3. fine tune a pre-trained model with your customized dataset

how it works

the network used in this project is vgg16 and it was pre-trained by Oxford to classify 2622 identities. Check this paper for more details. Since their model was trained for a classification purpose, it must be tuned to fit verification tasks. A triplet loss is used in this project just as what the paper describes. For more details about triplet loss, check this Google facenet paper

how to install

  1. install anaconda for python 3
  2. install tensorflow
  3. install keras (theno backend is not tested)
  4. install other python packages such as tqdm

how to perform face detection and alignment

run TestCases\test_align_database.py

Datasets used

different face datasets were used in this project, they are LFW dataset (http://vis-www.cs.umass.edu/lfw/) AR dataset (http://www2.ece.ohio-state.edu/~aleix/ARdatabase.html) CAS-PEAL dataset (http://www.jdl.ac.cn/peal/)

how to perform verification

any face dataset can be used, since lfw data set is easy to download and prepare, we use lfw dataset for illustration

  1. download lfw dataset. Since we have our own align implementation. it is recommended to download data without alignment. the quick link is here
  2. align the lfw database. Open TestCases\test_align_database.py and edit the following two lines
source = 'imgs\\align_test\\origin'
target = 'imgs\\align_test\\aligned'

run test_align_database.py after running, you should get a folder of aligned images.

  1. download the model:
    • todo: provide download link
  2. open cfg.py and modify the '_dir_models' variable, it changes the absolute path to the model
  3. open TestCases\test_verification_on_general_dataset.py and change dir_image to be the root directory of aligned images 6.run test_verification_on_general_dataset.py

how to train the network

  • we still use lfw dataset to illustrate the process, in practice, any face dataset can be used
  • note that it is recommended to use a GPU to train. Training on a cpu machine could be very slow.
  1. open train.py and modify this line: reader_LFW = LFWReader(dir_images='E:\DM\Faces\Data\LFW\aligned') set the directory to be the absolute path of aligned lfw images
  2. run the train.py code

vgg-face-fine-tune's People

Contributors

ao-lee avatar

Watchers

James Cloos 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.