SCRFD issues
See original GitHub issueHi! 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 bothscrfd_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!
Issue Analytics
- State:
- Created 2 years ago
- Comments:23 (12 by maintainers)
Top GitHub Comments
@nttstar , I have retrained
scrfd_2.5g_bnkps
, with batch norm replaced with group norm (new model should be calledscrfd_2.5g_gnkps
i think), just like forscrfd_2.5g
model, I achieved following WiderFace AP: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
In TensorRT you should load optional layers support, for Python TRT API you should just add this line just after import: