IrvingMeng / MagFace

MagFace: A Universal Representation for Face Recognition and Quality Assessment, CVPR2021, Oral
Apache License 2.0
613 stars 87 forks source link

ANY SMALLER SIZE OF MAGFACE MODEL? #64

Open sfxeazilove opened 9 months ago

sfxeazilove commented 9 months ago

Hi, Thank you for your work, i would love to know if there are any smaller version of the model, specifically between 20 - 50MB. i am currently researching on how accurate light weight models are on face verification. and i am very interested in MagFace

IrvingMeng commented 9 months ago

Apologies, but I currently don't have any lightweight models in my hand.

sfxeazilove commented 9 months ago

Alright i am currently training the model with iresnet18, but i noticed the first epoch and second epoch which are being a saved have a size of 518mb each, but when you trained with resnet100 at the 25th epoch, the size was at 270mb. Any ideas as to why mine with lesser layers is heavier than yours? all i did was use a different backbone and reduce my batch_size from 512 to 128, because of my gpu

IrvingMeng commented 9 months ago

Hi, the saved model includes a feature extractor and a classification layer. The classification layer is of size (feature_dim) x (num_class), and will be heavy if there are many classes. Actually, the classification layer is not used during inference. You can consider ignoring it when saving the model weights.

sfxeazilove commented 8 months ago

Thank you for your feedback, it was quite helpful. the size with resnet18 is now actually at 91.8mb, so i am trying furthermore by implementing MobileNetV2 architecture to train, i saw the issue that was raised regarding this and i implemented in that same manner but however, i am getting 0.00 on the Acc@1 and Acc@5. Any help you can render to this?

image
sfxeazilove commented 7 months ago

Hi , please is there a way you can help with implementing MobilenetV2 for this, i am still getting Acc@1 and Acc@5 to be 0.0, despite several modifications to my mobilenet architecture:

this is how i defined it in the load_features function

image

yes still the same issue. please it is quite urgent. Thank You

we11d0ne commented 2 months ago

Thank you for your feedback, it was quite helpful. the size with resnet18 is now actually at 91.8mb, so i am trying furthermore by implementing MobileNetV2 architecture to train, i saw the issue that was raised regarding this and i implemented in that same manner but however, i am getting 0.00 on the Acc@1 and Acc@5. Any help you can render to this?

image

Please can you tell me how to ignore the classification layer during training