deepinsight / deepinsight/insightface

SCRFD issues

Open
#1,518 29 comments 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

Hi! I'm testing your new SCRFD face detector and have noticed some issues with onnx inference code and network outputs:

1. In [scrfd.py](https://github.com/deepinsight/insightface/blob/f85e523d1355ef26c837e6381e3415a841b3a041/detection/scrfd/tools/scrfd.py#L275) line 275 you are filtering `bboxes`, but later at line 278 you return `det`, so `max_num` parameter have no effect and may cause exceptions.

2. Later at line [335](https://github.com/deepinsight/insightface/blob/f85e523d1355ef26c837e6381e3415a841b3a041/detection/scrfd/tools/scrfd.py#L335) 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`

3. 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:
![1](https://user-images.githubusercontent.com/17834919/118366122-1bc59980-b5a8-11eb-8e07-cf17b797fcf4.jpg)
Original image size is 1200x1200.
As you can see when detection is run with resize to 640x640 score is 0.38
For `480x480` score is `0.86`, and for `736x736` score is `0.07`.
Same behavior is noticed for both `scrfd_10g_bnkps` and `scrfd_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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.