clcarwin / sphereface_pytorch

A PyTorch Implementation of SphereFace.
MIT License
714 stars 172 forks source link

When the shape of input is [1,3,112,96], the shape of output is [2,10574]? #54

Open yBeOne opened 4 years ago

yBeOne commented 4 years ago

A torch.randn[1,3,112,96] is as the input ,but the output is shape of [2,10574]? Why not [1,10574]?

njuaplusplus commented 3 years ago

The output is a tuple, according to the code.

But I don't know how to use this repo as a classifier.

clcarwin commented 3 years ago

please read lfw_eval.py: set net.feature = True for eval. fc5 is the embedding, fc6 is only used for train.

njuaplusplus commented 3 years ago

Thank you for your reply. I understand that for face verification (compute the distances), we need to set net.feature=True. My question is if I want to use the fc6 so the network functions as a classifier, what should I do? I think it's reasonable since it's trained as a classifier.

njuaplusplus commented 3 years ago

More specifically, could you give me some hints on how to get the prediction confidence of a given image with your pre-trained network. Thanks a lot.