Bug 434750 - Yolov3 doesn't work on png Images
Summary: Yolov3 doesn't work on png Images
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (show other bugs)
Version: 7.2.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-22 09:45 UTC by Sven
Modified: 2021-03-23 18:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2021-03-22 09:45:31 UTC
Yolov3 doesn't recognise faces in png images.
If the same image is saved as jpg, faces are recognised fine.


STEPS TO REPRODUCE
1. right click -> face recognision on an png image -> no face detected
2. resave image as jpg
3. right click -> face recognision on the jpg image -> face detected

OBSERVED RESULT


EXPECTED RESULT
faces should be detected on png images too

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: kubuntu 20.10
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2021-03-22 11:38:24 UTC
Why shouldn't Yolo-v3 work with PNG images? The digiKam face detection works with all image formats that can be loaded via the Dimm framework. So also PNG, RAW, DNG, PSD etc.

Tested here again with PNG files with individuals or groups of people, everything works without problems.

What does "Kubuntu" package mean exactly? Which digiKam version with git version exactly?
Please attach the debug output of a Yolo detection of a single image as described here:

https://www.digikam.org/contribute/

Better still upload a PNG as a sample, if not public, then privately to my email address.

Maik
Comment 2 Maik Qualmann 2021-03-22 11:42:08 UTC
Dimm ==> DImg

Maik
Comment 3 Sven 2021-03-23 08:18:59 UTC
(In reply to Maik Qualmann from comment #1)
> Why shouldn't Yolo-v3 work with PNG images? The digiKam face detection works
> with all image formats that can be loaded via the Dimm framework. So also
> PNG, RAW, DNG, PSD etc.
> 
> Tested here again with PNG files with individuals or groups of people,
> everything works without problems.
> 
> What does "Kubuntu" package mean exactly? Which digiKam version with git
> version exactly?
> Please attach the debug output of a Yolo detection of a single image as
> described here:
> 
> https://www.digikam.org/contribute/
> 
> Better still upload a PNG as a sample, if not public, then privately to my
> email address.
> 
> Maik

Sorry, Kubuntu Package was a mistake from me.
I'm using the appimage:

digiKam-7.2.0-rc-x86-64.appimage

I sent you a email with a sample picture
Comment 4 Maik Qualmann 2021-03-23 14:58:48 UTC
Thanks for the nice test image. Yes, with this image I can confirm the problem. The cause is the alpha channel of the PNG image. I suspect a problem converting DImg to OpenCV image. Both face recognition engines are affected. I have a look at it.

Maik
Comment 5 Maik Qualmann 2021-03-23 18:15:38 UTC
Git commit 2143dc216806592d0349d6d60296ce0894eeac18 by Maik Qualmann.
Committed on 23/03/2021 at 18:14.
Pushed by mqualmann into branch 'master'.

fix create OpenCV image, a DImg always has an alpha channel bitplane
FIXED-IN: 7.3.0

M  +2    -1    NEWS
M  +8    -19   core/libs/facesengine/detection/opencv-dnn/opencvdnnfacedetector.cpp

https://invent.kde.org/graphics/digikam/commit/2143dc216806592d0349d6d60296ce0894eeac18