Skip to content

Latest commit

 

History

History

facenet_pytorch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Face Recognition Using Pytorch

Input

3 face images.

angelina_jolie.jpg    bradley_cooper.jpg   kate_siegel.jpg

paul_rudd.jpg       shea_whigham.jpg

(Image from https://github.com/timesler/facenet-pytorch/tree/master/data/test_images)

Output

A similarity of each pair of images.

[['' 'angelina_jolie' 'bradley_cooper' 'kate_siegel' 'paul_rudd' 'shea_whigham']
 ['angelina_jolie' '0.0' '1.4458625' '0.89089304' '1.445407' '1.3876879']
 ['bradley_cooper' '1.4458625' '0.0' '1.3021401' '1.0183644' '1.0345106']
 ['kate_siegel' '0.89089304' '1.3021401' '0.0' '1.4002758' '1.3784742']
 ['paul_rudd' '1.445407' '1.0183644' '1.4002758' '0.0' '1.0893339']
 ['shea_whigham' '1.3876879' '1.0345106' '1.3784742' '1.0893339' '0.0']]

Usage

Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.

For the sample images,

$ python3 facenet_pytorch.py

If you want to specify the image folder, put the file path after the -d (--dir) option.

$ python3 facenet_pytorch.py -d IMG_DIR_PATH

-w (--weight) option select trained weights with the following datasets.

  • vggface2
  • casia-webface
$ python3 facenet_pytorch.py -w casia-webface

Reference

Framework

Pytorch

Model Format

ONNX opset=11

Netron