SUMMARY Face detection in large images can be improved by increasing the re-sizing parameter in the detection pipeline. To strike a balance between accuracy and performance, the parameter shouldn't be fixed. I propose exposing it to the user for manual adjustment. STEPS TO REPRODUCE 1. Load a large image (many pixels) into digikam 2. Use the facial detection feature OBSERVED RESULT Not all faces are found EXPECTED RESULT All faces are found SOFTWARE/OS VERSIONS Windows: Windows 11 Pro KDE Frameworks: 5.248.0 Qt: 6.6.1 ADDITIONAL INFORMATION Image re-scaling is an important part of the face detection pipeline because it improves the computation speed. Currently, the final image size after resizing is hard-coded in the source code (e.g. https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryolo.cpp#L42 for the Yolo model). This is problematic, because if an image is very big initially (many pixels), redical rescaling to the given size can make face detection impossible. By making this parameter adjustable by the user, we could improve the detection accuracy in such cases greatly.
What they picked out in the source code is not the scaled image size that is used. There are fixed values for the face model data. Upload a image in which not all faces are detected, if not publicly, then to my private email. At the moment I can't imagine that not all faces will be detectedf they have YoloV3 activated. Maik
Created attachment 168818 [details] image for which face detection does not work
Hi Maik, thanks for your quick answer. Please find my comments below. (In reply to Maik Qualmann from comment #1) > What they picked out in the source code is not the scaled image size that is used. Then what what sizes *are* used? > There are fixed values for the face model data. I'm sorry but I don't understand what you mean. > Upload a image in which not all faces are detected, if not publicly, then to my private email. See attachment above. > At the moment I can't imagine that not all faces will be detectedf they have YoloV3 activated. It is good that you have confidence in your code! Nevertheless, I am a bit confused by your open distrust in my bug report. Clearly, I am not the first one to ask for improvements to the face detection algorithm (e.g. https://bugs.kde.org/show_bug.cgi?id=485029 and https://bugs.kde.org/show_bug.cgi?id=433716). So what causes your mistrust?
If I remove the white frame, all faces are recognized. I think that a image with such a frame is a bit out of scope. Maik
reply to Maik Qualmann from comment #4) > If I remove the white frame, all faces are recognized. I think that a image with such a frame is a bit out of scope. I disagree. Imagine a mountain or a monument instead of the white frame. That is exactly the kind of image I have in my gallery that cause and for which the algorithm does not work because of the fixed scaling. Either way, I would appreciate if you told me the actual sizes that are used by digikam to rescale the pictures.
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Prevent this from being closed. I believe I have provided the needed info.
Michael, One point reported by end-user, this time about Yolo3 model. What's about YuNet and this proposal? It's compatible? It's already exists in your implementation? It's not necessary? Best Gilles
This is already included in new YuNet implementation and YuNet UI. It is the "face size" setting. When the use selects "large" or "extra large" faces, the code resizes the original image to around 500x500px depending on the selection. This makes processing much faster, but the small image size effectively "erases" small faces from the background. Selecting "extra small" faces reduces the image to around 2000x2000px (or uses the original image size if it's already smaller), which allows the model to find very small faces in the background, but makes detection slower and can introduce false-positives for facial detection. Cheers, Mike