nwesem / mtcnn_facenet_cpp_tensorRT

Face Recognition on NVIDIA Jetson (Nano) using TensorRT
GNU General Public License v3.0
203 stars 72 forks source link

how to train the classifier based on subfolders of different people? #33

Closed nupnup-goddamn closed 3 years ago

nupnup-goddamn commented 3 years ago

Hi, i would like to use subfolders in the imgs folder of different people so that i can have the classifier to train on mulitple images of the same person (person A) to better distinguish Person A from a display attack of person A (e.g. picture of person A on a phone display).

How should i modify the main.cpp code under getting embeddings of known faces as well as saving new faces of the same person into particular subfolder of that person in the imgs folder?

shubham-shahh commented 3 years ago

you need to create a separate program which iterated through the folders of images and save embedding of the at person corresponding to the name and save it in a pickle file. you need to load this pickle file in your program and compare the embedding in pickle file with the ones received from the model at any instance.

nupnup-goddamn commented 3 years ago

you need to create a separate program which iterated through the folders of images and save embedding of the at person corresponding to the name and save it in a pickle file. you need to load this pickle file in your program and compare the embedding in pickle file with the ones received from the model at any instance.

Thanks for your insights! I now know how to iterate the folders using os library and saving the model training as a pkl file. cheers!