0

I want to calculate the similarity or distance of two faces. I'm using Python.

I have read and done what this tutorial says. However, the result is not good (the similarity of same faces and similarity of different faces are very very very close to each other!).

I have downloaded and used this Facenet model to get face embedding vectors, and then used 3 distance metrics (Euclidean, Manhattan, Cosine) to calculate the distance.

After that, I decided to retrain that Facenet model with my dataset. I read this article. I want to use the triplet loss to retrain that Facenet model.

How can I retrain that Facenet model with the triplet loss function? Or can you please send me some links to read?

nbro
  • 39,006
  • 12
  • 98
  • 176
behrad
  • 101
  • 1

1 Answers1

0

If you want to train a model that is similar to Facenet, you have to train a Triplet Loss Neural Network similar to the one that you have seen in the tutorial. After training the full network you have to use only a part of the network that is used for embeddings extraction not the whole network, so when you call model.predict() you will get embeddings as output.

For more theoretical info, you can refer to Andrew NG lecture about it

For practical part, unfortunately there is no too much but hopefully this can help at least for building and using the network.