Bug 498281 - No faces detected: -215:Assertion failed) inputs[vecIdx][j] == inputs[i][j] in function 'getMemoryShapes'
Summary: No faces detected: -215:Assertion failed) inputs[vecIdx][j] == inputs[i][j] i...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Engine (show other bugs)
Version: 8.5.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-05 14:48 UTC by Hermann Schwarting
Modified: 2025-01-13 20:27 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hermann Schwarting 2025-01-05 14:48:07 UTC
SUMMARY

When running face detection on an album with photos with people’s faces visible, no faces are detected. This error is logged:

[ERROR:0@14,429] global ./modules/dnn/src/net_impl.cpp (1184) getLayerShapesRecursively Exception message: OpenCV(4.6.0) ./modules/dnn/src/layers/eltwise_layer.cpp:251: error: (-215:Assertion failed) inputs[vecIdx][j] == inputs[i][j] in function 'getMemoryShapes'


STEPS TO REPRODUCE
1. Start digikam from a terminal
2. Right-click on an album and select “Scan for Faces”

OBSERVED RESULT

No faces are detected.

Face detection appears to be starting. The progress bar shows that photos are processed one by one. In the end a popup appears:

Items scanned for faces: 4 Faces processed: 0

Where “4” is the number of photos in the album and “Faces processed” is always 0.

These messages are logged once for every photo:

[ERROR:0@15.822] global ./modules/dnn/src/net_impl.cpp (1168) getLayerShapesRecursively OPENCV/DNN: [Eltwise]:(onnx_node!Add_44): getMemoryShapes() throws exception. inputs=2 outputs=1/1 blobs=0
[ERROR:0@15.822] global ./modules/dnn/src/net_impl.cpp (1174) getLayerShapesRecursively     input[0] = [ 1 64 29 38 ]
[ERROR:0@15.822] global ./modules/dnn/src/net_impl.cpp (1174) getLayerShapesRecursively     input[1] = [ 1 64 28 38 ]
[ERROR:0@15.822] global ./modules/dnn/src/net_impl.cpp (1178) getLayerShapesRecursively     output[0] = [ 1 64 29 38 ]
[ERROR:0@15.822] global ./modules/dnn/src/net_impl.cpp (1184) getLayerShapesRecursively Exception message: OpenCV(4.6.0) ./modules/dnn/src/layers/eltwise_layer.cpp:251: error: (-215:Assertion failed) inputs[vecIdx][j] == inputs[i][j] in function 'getMemoryShapes'


EXPECTED RESULT

Faces should be detected and known persons should be recognized if possible.


SOFTWARE/OS VERSIONS
Digikam: 4:8.5.0-1+b1
Linux: Debian testing “trixie”
KDE Plasma Version: 6.8.0-1
KDE Frameworks Version: 6.8.0-1
Qt Version: 6.7.2+dfsg-5
OpenCV (packages libopencv-core406t64 libopencv-dnn406t64 libopencv-imgcodecs406t64 libopencv-imgproc406t64 libopencv-ml406t64 libopencv-objdetect406t64): 4.6.0+dfsg-14+b2
Comment 1 Maik Qualmann 2025-01-05 15:24:49 UTC
The OpenCV version 4.6 used in Debian is too old. The new SFace face recognition used in digiKam-8.5.0 requires at least OpenCV-4.8.

Maik
Comment 2 Maik Qualmann 2025-01-05 15:38:49 UTC
Git commit 4d754e1416bd18641a667cf24c2e9b36856497d5 by Maik Qualmann.
Committed on 05/01/2025 at 15:37.
Pushed by mqualmann into branch 'master'.

set OpenCV-4.8.0 as minimum version
FIXED-IN: 8.6.0

M  +1    -1    core/CMakeLists.txt

https://invent.kde.org/graphics/digikam/-/commit/4d754e1416bd18641a667cf24c2e9b36856497d5
Comment 3 Michael Miller 2025-01-13 13:41:04 UTC
*** Bug 498603 has been marked as a duplicate of this bug. ***
Comment 4 Hermann Schwarting 2025-01-13 20:27:32 UTC
Thank you!

This got fixed in the Debian package version 4:8.5.0-3 (currently experimental) by increasing the OpenCV dependency to 4.10.