question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 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 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 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!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
SthPhoenixcommented, May 26, 2021

@nttstar , I have retrained scrfd_2.5g_bnkps, with batch norm replaced with group norm (new model should be called scrfd_2.5g_gnkps i think), just like for scrfd_2.5g model, I achieved following WiderFace AP:

Model Easy Medium Hard
scrfd_2.5g_bnkps 93.80 92.02 77.13
scrfd_2.5g_gnkps 93.57 91.70 76.08

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

1reaction
SthPhoenixcommented, Sep 24, 2021

Then i change to scrfd_34g_gnkps, it works, but GN not supported by tensorRT(@SthPhoenix can you tell me how to transform GN onnx models to RT models?)

In TensorRT you should load optional layers support, for Python TRT API you should just add this line just after import:

import tensorrt as trt
trt.init_libnvinfer_plugins(None, "")
Read more comments on GitHub >

github_iconTop Results From Across the Web

face detection scrfd #1514 - deepinsight/insightface · GitHub
I ran the demo/image_demo.py file with the model SCRFD_2.5G_KPS and the results were as follows: Screenshot from 2021-05-14 11-40-10
Read more >
SCRFD | InsightFace: an open source 2D&3D deep face ...
In this paper, we point out that training data sampling and computation distribution strategies are the keys to efficient and accurate face detection....
Read more >
Developers - SCRFD issues - - Bountysource
Hi! I'm testing your new SCRFD face detector and have noticed some issues with onnx inference code and network outputs:.
Read more >
CPU Plugin Does Not Work as Expected on SCRFD ... - Intel
Tried to run the SCRFD face detector; Wrong outputs are obtained on the CPU but correct on GPU. Resolution. ONNX (Open Neural Network...
Read more >
Sample and Computation Redistribution ... - Papers With Code
... on WIDER FACE demonstrate the state-of-the-art efficiency-accuracy trade-off for the proposed \scrfd family across a wide range of compute regimes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found