facenet-pytorch-glint360k icon indicating copy to clipboard operation
facenet-pytorch-glint360k copied to clipboard

Error with code in readme for pretrained model

Open intergalaticSpaceDog opened this issue 4 years ago • 2 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'

intergalaticSpaceDog avatar Aug 11 '20 00:08 intergalaticSpaceDog

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.

tamerthamoqa avatar Aug 11 '20 04:08 tamerthamoqa

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

intergalaticSpaceDog avatar Aug 11 '20 11:08 intergalaticSpaceDog