davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.74k stars 4.8k forks source link

How to make inference on a single image? #1235

Open Egordfp opened 1 year ago

Egordfp commented 1 year ago

Hello.

Im new to programming, and trying to make some face recognition pipeline for my minor.

The idea is that i want to train my model to detect and classify some anime characters (including real time on video).

Im using this facenet implementation for feature extraction (512 vector) and recognition. I did the custom training on my dataset via "python src/classifier.py TRAIN" as it was described in an article on custom training. It worked with 96% accuracy so thats good.

Now the only thing i need is actually to make inference on a single image to get this 512 vector so i can use my custom trained "classifier.pkl " model to get a final result? I've been searching the whole day all over the internet and i just couldnt understand how to make inference. I see info about training/validation but not about actual inference on a single image.

When doing training, i was refereing to "20180402-114759.pb" model architecture and saved my classifier file as a pkl. I just want to know how can i now actually make inference and get the results..

Jawabreh0 commented 1 year ago

if you mean you want to make prediction on a single image using your trained model, check the pipeline in this repo, and check the test.py file and train.py file https://github.com/Jawabreh0/HumanexAI_FaceRecognition if your interested to read article about how this is exactly working check this medium article https://medium.com/@Jawabreh0/advanced-face-recognition-system-a392787cfe6