-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Simple FaceDetectorYN speedup by pre-culling face bboxes? #25056
Copy link
Copy link
Closed
Labels
Description
Describe the feature and motivation
While reviewing FaceDetectorYNImpl::postProcess to see how it worked, I noticed that the scoreThreshold is only used to cull faces in the non-maximum suppression call late in the function. I think an opportunity exists to just not add the box unless it meets the scoreThreshold around this line of code as dnn::NMSBoxes does that anyways later:
opencv/modules/objdetect/src/face_detect.cpp
Line 200 in f0e3d2f
| float score = std::sqrt(cls_score * obj_score); |
If I understand correctly, this would be a helpful advantage because there are typically many 1000's of raw face boxes but after thresholding on the score it could often drop to well below 100, which would help with a few things: dynamic memory allocation up front, reduced copies to
faceBoxes, and reduced input to dnn::NMSBoxes.
Does this seem reasonable or am I missing something important about how it works?
Additional context
No response
Reactions are currently unavailable