esimov / pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
MIT License
4.39k stars 310 forks source link

Too many false detections #30

Closed dimuls closed 4 years ago

dimuls commented 4 years ago

I'm using pigo in my realtime app and observing many false detections. How can i reduce amount of them? Does pigo have some parameters to adjust?

esimov commented 4 years ago

You have to play with the various parameters provided by the library. In general to reduce the false positive rates you have to consider the detection window over you are running the face detector. Also there are three core components responsible for the detection score: iou, shift and scale. I would recommend first to try modifying the first two options. Read the documentation and also this blog post: https://www.esimov.com/2019/07/pigo-face-detection-library.

If the obtained results are still not satisfying please provide me a sample image with the applied parameters and i will try to help you.

dimuls commented 4 years ago

1

On this image with params iou=0.2, shift=0.1, scale=1.1 pigo detected face in rectangle (171,331)-(271,431).

This kind of false detections occurs regularly on random frames when i'm processing live stream with pigo. Gocv with lbpcascade_frontalface_improved.xml under the same conditions (same video streams) gives no false detections.

I read documentation but didn't find any hints how to adjust this params. I can try to adjust them randomly but maybe you can speed up this process.

Another problem i faced: rarely pigo detects face with too large scale (more larger than actual face).

esimov commented 4 years ago

I have tried with the default parameters and also with the parameters you have provided but no face have been detected. If you download the attached image and run over it pigo with the default parameters it should not detect any face.

Regarding the last issue, the scale param has nothing to do with the face dimension. To detect large faces, I mean faces with the rectangular area greater than the min and max values, you have to adjust these values.

esimov commented 4 years ago

Since I haven't received any feedback i'm closing this issue. You can reopen at any time.