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

Can I request torch model files (scrfd_10g_gnkps)? #103

Open
markdchoung opened this issue Dec 1, 2022 · 5 comments
Open

Can I request torch model files (scrfd_10g_gnkps)? #103

markdchoung opened this issue Dec 1, 2022 · 5 comments

Comments

@markdchoung
Copy link

markdchoung commented Dec 1, 2022

I was confirmed that the same problem occurred when a model using batch normalization was used.
Thanks for solving the problem by using group normalization!

  1. I need torch model files to use batch inference and utilize multi-gpu environment.
    Would you give me torch model files? Especially, I need scrfd_10g_gnkps.
    or if you have scrfd_34g_gnkps, that would be very helpful for me!

  2. And I completed to reproduce the general SCRFD model, and I am looking for a tutorial on how to reproduce gnkps model (or bnkps). Can you give me that information?

  3. Is there any way to perform batch inference with onnx model(scrfd_10g_gnkps) that you are providing?

@SthPhoenix
Copy link
Owner

Hi! I'm not sure If i'll be able to find raw torch checkpoints, but:

  1. This repo provides batch processing using TensorRT, multiple GPU can be utilized by running multiple API instances behind load balancer.
  2. You can uncomment this line of default config and comment line 190, and that's it )
  3. In this repo batch inference is supported using NVIDIA TensorRT backend, ONNX backend might be modified for this task too, but I recall there were some issues with batch inference on CPU, and in this repo onnxruntime is used mostly as fallback for CPU inference where GPU is not availiable.

@markdchoung
Copy link
Author

Thanks @SthPhoenix !
I have reproduced scrd_10gf_gnkps and scrd_32gf_gnkps with training codes from insightface.
Validation results on tensorboard were good enough (torch model), but the performance sharply dropped after convering into onnx. I used onnx conversion script from insightface without any changes.
You released 10gf_gnkps model, and how did you convert trained torch model into onnx model?

@SthPhoenix
Copy link
Owner

Hi! I have used exactly the same script from insightface repo.

@markdchoung
Copy link
Author

Hi! I have used exactly the same script from insightface repo.

I followed your guide to train GNKPS models, but the model performance cannot be reproduced. The model performed well on widerface validation dataset, but it performed poorly on images with large faces.

Did you train with the following configuration?

norm_cfg=dict(type='GN', num_groups=16, requires_grad=True),
cls_reg_share=True,
strides_share=False,

Did you train the model without any other additional methods? Then, the trained model perform well on large faces?
How many gpu did you use? The total batch size will vary depending on the number of gpu, could this also affect the performance? I used 8 gpus for training.

@SthPhoenix
Copy link
Owner

Hi! Yes, I have used this config, I have trained models on single GPU, some on rtx2080, some on rtx3090.
I can't recall if I have changed batch size, but I have trained models a bit longer than 640 epoch, something around 720-760 epochs to reach peak accuracy.
Also I have tried training 34g model, and I wasn't able to solve large faces problem for this model - it still wasn't able to detect them.
Now I'm using mainly yolov5-face models for detection - since they performs better in most cases, and don't suffer from this bug.

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

2 participants