kandekar007 / Insight_Face_pyTorch

pytorch implementation of insight face for face recognition.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InsightFace_Pytorch

Pytorch0.4.1 codes for InsightFace


1. Intro


2. Pretrained Models & Performance

IR-SE50 @ Onedrive

Mobilefacenet @ OneDrive

3. How to use

for images:

python face_verify.py

3.1 Data Preparation

3.1.1 Prepare Facebank (For testing over camera or video)

Add the face images data/facebank folder, and guarantee it have a structure like following:

data/facebank/
        ---> id1/
            ---> id1_1.jpg
        ---> id2/
            ---> id2_1.jpg
        ---> id3/
            ---> id3_1.jpg
           ---> id3_2.jpg

3.1.2 download the pretrained model to work_space/model

If more than 1 image appears in one folder, an average embedding will be calculated

3.2.3 Prepare Dataset ( For training)

download the refined dataset: (emore recommended)

Note: If you use the refined MS1M dataset and the cropped VGG2 dataset, please cite the original papers.

  • after unzip the files to 'data' path, run :

    python prepare_data.py
    

    after the execution, you should find following structure:

faces_emore/
            ---> agedb_30
            ---> calfw
            ---> cfp_ff
            --->  cfp_fp
            ---> cfp_fp
            ---> cplfw
            --->imgs
            ---> lfw
            ---> vgg2_fp

3.2 detect over camera:

- facebank/
         name1/
             photo1.jpg
             photo2.jpg
             ...
         name2/
             photo1.jpg
             photo2.jpg
             ...
         .....
    if more than 1 image appears in the directory, average embedding will be calculated
  • 4 to start

    python face_verify.py 
    

3.3 detect over video:

​```
python infer_on_video.py -f [video file name] -s [save file name]
​```

the video file should be inside the data/face_bank folder

3.4 Training:

​```
python train.py -b [batch_size] -lr [learning rate] -e [epochs]

# python train.py -net mobilefacenet -b 200 -w 4
​```

4. References

PS

  • PRs are welcome, in case that I don't have the resource to train some large models like the 100 and 151 layers model
  • Email : treb1en@qq.com

About

pytorch implementation of insight face for face recognition.


Languages

Language:Jupyter Notebook 94.9%Language:Python 5.1%