liorshk / facenet_pytorch Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation of the paper "FaceNet: A Unified Embedding for Face Recognition and Clustering"
License: MIT License
PyTorch implementation of the paper "FaceNet: A Unified Embedding for Face Recognition and Clustering"
License: MIT License
Hello,
would you please tell why do it like this?
Why I cannot access the dataset link here?
PermissionError: [Errno 13] Permission denied: '/media/lior'
Hi @liorshk
Thanks for sharing your code. It seems clean and well-written, however, I had problem having it converge.
I trained it on filtered version of MsCeleb with 5 Million images and 79K identities. Your hyper-parameters seems to be identical with the Tensorflow implementation davidsandberg/facenet and I also tried different ones but I never got more than 65% accuracy on LFW.
I think it's mostly because of the way that triplet selection has been implemented. The paper suggests having batches of 1800 images from a certain number of identities (40-45), rather than choosing it completely randomly. I tried this but only with 180 images at most, yet still it didn't converge.
Do you have any idea that can help me? If you had any success training the model, could you please share your weights too?
Thanks,
when I train triplet loss, I find bug in here:
out_selected_a = Variable(torch.from_numpy(out_a.cpu().data.numpy()[hard_triplets]).cuda())
out_selected_p = Variable(torch.from_numpy(out_p.cpu().data.numpy()[hard_triplets]).cuda())
out_selected_n = Variable(torch.from_numpy(out_n.cpu().data.numpy()[hard_triplets]).cuda())
it should be out_a[hard_triplets]. Otherwise, grad won't be caculated.
Why do you create pairwise function instead of pytorch's nn.PairwiseDistance?
I changed pairwise function with nn.PairwiseDistance
but evaluating is not working. (Too slow!)
Do you have any idea about this?
out_selected_a = Variable(torch.from_numpy(out_a.cpu().data.numpy()[hard_triplets]).cuda())
out_selected_p = Variable(torch.from_numpy(out_p.cpu().data.numpy()[hard_triplets]).cuda())
out_selected_n = Variable(torch.from_numpy(out_n.cpu().data.numpy()[hard_triplets]).cuda())
will lead to
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
why not use:
out_selected_a = out_a[hard_triplets]
out_selected_p = out_p[hard_triplets]
out_selected_n = out_n[hard_triplets]
Hello, I try to run your code. However, i cannot find the download link for, would you mind sharing me this link. In addition, i want to check is the link of lfw-align-mtcnn in your train_center.py http://vis-www.cs.umass.edu/lfw/lfw-deepfunneled.tgz? Thank you so much.
Dear @liorshk,
Thank you for your code. Do you have any pre-trained models? Would you please, release the weights of your pre-trained models?
Hello, author, can you tell me the running environment of this code?Examples include the Python version and the PyTorch version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.