Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANY SMALLER SIZE OF MAGFACE MODEL? #64

Open
sfxeazilove opened this issue Nov 20, 2023 · 6 comments
Open

ANY SMALLER SIZE OF MAGFACE MODEL? #64

sfxeazilove opened this issue Nov 20, 2023 · 6 comments

Comments

@sfxeazilove
Copy link

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
Copy link
Owner

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

@sfxeazilove
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link

we11d0ne commented Jun 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants