penincillin / DREAM

This is the public repository for our accepted CVPR 2018 paper "Pose-Robust Face Recognition via Deep Residual Equivariant Mapping"
http://mmlab.ie.cuhk.edu.hk/projects/DREAM/
BSD 2-Clause "Simplified" License
388 stars 98 forks source link

How to understand "class_num" ? #46

Closed CyL97 closed 5 years ago

CyL97 commented 5 years ago

I want to use your pretrained model to test some image, but I cannot understand the class_num = 13386 in eval_cfp.py and class_num = 87020 in eval_ijba.py. I see your define of class_num in end2end/main.py but it seems the meaning of class_num is the number of person.

But I see the number of person in CFP dataset is 500 and your class_num is 13386 ? Could you please explain what class_num mean exactly ? thx @penincillin

penincillin commented 5 years ago

class_num is the number of identity in training, which determines the dim of the last fc layer of the network. Therefore, in evaluation code, in order to make the evaluation model consistent with the trained model, otherwise, when loading trained weights, there will be a bug report. We set class_num to 13386 and 87020, separately. You can just ignore these two numbers.

CyL97 commented 5 years ago

1 thx for reply. Actually I have another question. When I use pretrained weight to test my own images, I get a list of classes label just like the picture. How do I understand what the numbers in the list represent? I guess a number represents a name of celeb, but where can I get the name_list ? Hope your reply. thx @penincillin

penincillin commented 5 years ago

Yes, your understand is right. But during evaluation, you can just neglect the output of the last fc layer and use the output of the second last fc layer as the feature of the input images. Then you could use this feature to do face recognition and face verification.

CyL97 commented 5 years ago

Thx for your reply. I can use your model to train my own dataset now. But if I'd like to use this model to recognize some celebity, I hope to use last fc layer directly. Now the problem is that can I get a list of names of celebrities using the array I get from last fc layer ? Where can I find a list of name to map the classes label I get ? Or if you can provide a list of names to map the label? thx @penincillin

penincillin commented 5 years ago

Sorry, the original name list cannot be found right now

CyL97 commented 5 years ago

it's ok. thx for reply. @penincillin