tamerthamoqa / facenet-pytorch-glint360k

A PyTorch implementation of the 'FaceNet' paper for training a facial recognition model with Triplet Loss using the glint360k dataset. A pre-trained model using Triplet Loss is available for download.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with code in readme for pretrained model

intergalaticSpaceDog opened this issue · comments

Hello, I tried your pretrained model with the code in the readme file but I get the below error. If I only pass in 'img' to preprocess it works but results aren't that great. Is there something I'm doing wrong? Thanks!

img = preprocess(img.to(device))
AttributeError: 'numpy.ndarray' object has no attribute 'to'

Hi intergalacticSpaceDog,

Yeah my bad. The '.to()' method is a Torch Tensor method but the img was not preprocessed to be turned into a Torch Tensor yet. I have fixed the README example. Please tell me if other issues arise.

Also keep in mind the pre-trained model would not perform that well for more than a small-scale scope (would say 10 stored human identities and less). And also keep in mind this is still work in progress, I have added a disclaimer in the README.

Thanks! I appreciate your hard work and sharing with community.