New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Embeddings classification ability #134
Comments
The loss used for training is different in openface compared to this implementation, but I don't think that should cause any major differences in how the resulting embedding can be used. |
Thank you for the suggestion,
which seems to load the image with cv2.imread as BGR and converts it to RGB. |
I did further look into it and replaced the data reading with the routine used in Facenet. After this the results did improve significantly, even more than i expected, compared to the Openface results. What would you say is the cause for such a difference to Openface, the different loss function? as the embedding dimensions are the same. |
Hi @lodemo! |
Hi, What do you mean exactly under distractors? Higher number of people? plan to do that in the next run. |
Hi, Error: Is the file corrupt or does it need to be loaded differently as the 20161116-234200 model? |
Hi, |
Thank you, regards |
I ran the scripts with the new model 20170117-215115, it seems to improved the result further. More prominently in the higher number of people, which i increased up to 1600 (the number of people in LFW with 2 or more images) Model 20161116-234200: Model 20170117-215115: What is interesting, comparing the training time needed for the above results compared with Openface. Both training a LinearSVC with one vs. rest scheme: As the dimension are both the same, the SVM seems to take longer fitting the Facenet features. |
@lodemo It's amazing work! I follow https://github.com/cmusatyalab/openface/blob/master/evaluation/lfw-classification.py and add the facenet model(20170117-215115), my result is not so good as you got. What did you improve? The C parameter of LinearSVC? |
Actually not, i did leave C=1 but i used the One vs. All scheme explicitly Did you apply all the preprocessing for the Facenet images? I am currently also running evaluation of Openface and Facenet on the YouTube faces database. |
I see, its probably because you resize the images for Facenet to 96, which if you use the pre-trained model should be 160. Or do you call getData with resize=160 for Facenet? Did you align the images to 160 with Mtcnn? |
Yes, The lfw images are aligned to size 160*160 and I got facenet data with resize=160. Otherwise a shape mismatch error would be raised.
Did you filter lfw images with https://github.com/cmusatyalab/openface/blob/master/util/prune-dataset.py? I did it with --numImagesThreshold=5, then the persons with less than 5 images are filtered. The total number of the left persons is 423. |
Ah no i did not prune images. In |
You can try running my version of the script, see if anything changes. I split most methods for Openface and Facenet, a little redundant but works for now. |
Thanks @lodemo . The difference is on the align method. According to https://cmusatyalab.github.io/openface/demo-3-classifier/ , I use dlib align. The former result is based on the dlib_aligned faces. |
Hello,
i wanted to create a comparison between different face recognition techniques in a classification context.
For this i reused the classification experiment from Openface (https://github.com/cmusatyalab/openface/blob/master/evaluation/lfw-classification.py) and integrated Facenet into it.
The results are however not as i would have thought. Even at 10 different people accuracy is only around 0.5. Are the resulting image embeddings different to the one from Openface in their ability to be used directly in classification, using a classifier like SVM?
At the moment im feeding a single image to the network like this and use the resulting embedding as the representation for classification/evaluation:
imgs = np.reshape(img, (1, 160, 160, 3)) # img is (160, 160, 3)
feed_dict = { images_placeholder:imgs }
emb = sess.run(embeddings, feed_dict=feed_dict)
rep = emb[0]
Or is the error perhaps in the evaluation of the results? Currently using the same accuracy calculation like Openface, the accuracy_score function from sklearn.metrics.
regards
The text was updated successfully, but these errors were encountered: