Skip to content

Latest commit

 

History

History
77 lines (68 loc) · 3.29 KB

README.md

File metadata and controls

77 lines (68 loc) · 3.29 KB

Face_Recognition

Fine tune Facenet-pytorch with custom dataset
You can see the original in here facenet-pytorch
I recognition 31 persons , you can see in here

Link dataset

Data

Clone the repository

git clone https://github.com/conggalam12/Face_Recognition.git

Install requirement

cd Face_Recognition
pip install -r requirements.txt

Download and setup weights

mdkir weights
cd weights
wget https://github.com/conggalam12/Face_Recognition/releases/tag/weights/resnet_face.pth

Train with custom dataset

Setup your dataset

|-img
  |-- Name person 1
      |--- image_person_1_1.jpg
      |--- image_person_1_2.jpg
  |-- Name person 2
      |--- image_person_2_1.jpg
      |--- image_person_2_2.jpg

Setup folder train

You set path_folder in train.py

data_dir = 'folder_data_img'

And you run train MTCNN , take the face each images like that
img1 img2

Continue train facenet

Using with single face but not show box

python demo.py --path_img [path_your_image] --path_model [path_your_model]

Using with single face

python demo_single.py --path_img [path_your_image] --path_model [path_your_model]

Result single face

img1 img2
img3 img4

Use with multiple faces

python demo_multi.py --path_img [path_your_image] --path_model [path_your_model]

Result multiple face

img1 img2

References

  1. David Sandberg's facenet repo: https://github.com/davidsandberg/facenet

  2. F. Schroff, D. Kalenichenko, J. Philbin. FaceNet: A Unified Embedding for Face Recognition and Clustering, arXiv:1503.03832, 2015. PDF

  3. Q. Cao, L. Shen, W. Xie, O. M. Parkhi, A. Zisserman. VGGFace2: A dataset for recognising face across pose and age, International Conference on Automatic Face and Gesture Recognition, 2018. PDF

  4. D. Yi, Z. Lei, S. Liao and S. Z. Li. CASIAWebface: Learning Face Representation from Scratch, arXiv:1411.7923, 2014. PDF

  5. K. Zhang, Z. Zhang, Z. Li and Y. Qiao. Joint Face Detection and Alignment Using Multitask Cascaded Convolutional Networks, IEEE Signal Processing Letters, 2016. PDF