-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
SCRFD issues #1518
Comments
Hi @SthPhoenix, thanks for your attention.
|
BTW: if you're in a single-face situation, input size of 384/256(even 128) without padding is recommended. |
I'm developing face recognition REST API based on InsightFace models and TensorRT inference backend. It looks like that new detector was mostly optimized for small faces and is a bit undertrained for large faces. Can it be somehow fixed during training or is it a design flaw? |
My suggestion( if you want to use the pre-trained models ): |
Thanks! I was investigating these options yesterday, option 2 is more promising but more logically complicated. |
Little update: this bug seems to be related only to |
@nttstar , I have retrained
As you can see this config gives a small accuracy decrease, while completely solves problem with large faces. For above example I'm getting score around 0.7 |
@SthPhoenix Thanks! Did you make the feature maps shared? BTW, you can open a new repo to place this new model so that I can give a link to it, if you want. |
No, shared feature maps seems to reduce accuracy more noticably.
I'm training |
@SthPhoenix So you still using widerface, only change the config? |
Yes, just it. |
|
I have tested it by modifying
After 640 epoch I've got following mAP: So I have trained
BTW, |
Shared feature map should be better by using GN, from my experiments of resnet based backbone. |
Hmmm, I'll check it on other models, thanks! |
I have released retrained models at my repo.
All models were trained with following settings:
Model |
Hi,I just run the bash |
Hi @czzbb ! My config was based on |
Hi, I can't reproduce the official results(I just got 62.4, while it should be 77 ap). So I wonder is there anything I ignore. I download the datasets and annoations, and then directly run |
If you are using original configs you should get mAP close to published values without issues. |
Thanks a lot! I got this 62.4 ap during training. But I get 77 ap using the evaluation script. Can't imagine the difference could be so huge. |
@nttstar @SthPhoenix |
In TensorRT you should load optional layers support, for Python TRT API you should just add this line just after import:
|
Hi, @tuoyuxiang @SthPhoenix I followed the guide above, 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?
Did you train the model without any other additional methods? Then, the trained model perform well on large faces? |
I use this to improve large faces, you can try it: |
Hi, there. I found that using default scales augmentation (range = [0.3, 0.45, ..., 2.0]) for training process could make tons of tiny faces be negative samples by using ATSS, but in widerface evaluation, these tiny faces are important on hard protocol evaluation. Base on ATSS algorithm, one step is to select anchors inside gt boxes. These tiny faces could not be included by selected anchors or have little anchors to be predicted. Does anyone have this question and how do you explain and solve it? By the way, I solve large face problem by replacing |
@SthPhoenix Can you share your docker file with me for training scrfd in docker? I made one docker file, but in the training process in docker and in specific epochs, the training stopped with an error. |
Hi! I'm testing your new SCRFD face detector and have noticed some issues with onnx inference code and network outputs:
In scrfd.py line 275 you are filtering
bboxes
, but later at line 278 you returndet
, somax_num
parameter have no effect and may cause exceptions.Later at line 335 you are calling detector without providing input shape, which wont work with model having dynamic shape. However it won't be an issue when called from
face_analysis.py
I have noticed that detector returns very low scores or even fails on faces occupying >40% of image, it's especially visible for square shaped images, when there can't be provided additional padding during resize process. Also I have noticed that in such cases accuracy increases when lowering detection size (i.e. 480x480), and decreases when increasing it (i.e 1024x1024).
Here is an example of detection at 640x640 scale:
Original image size is 1200x1200.
As you can see when detection is run with resize to 640x640 score is 0.38
For
480x480
score is0.86
, and for736x736
score is0.07
.Same behavior is noticed for both
scrfd_10g_bnkps
andscrfd_2.5g_bnkps
models.In some cases it might be fixed by adding fixed padding around image, but it might lead to decreased accuracy for other image types, so it can't be applied by default.
BTW: Thanks for your great work!
The text was updated successfully, but these errors were encountered: