Bug 507113 - Face recognition does not identify faces even after scanning hundreds of faces.
Summary: Face recognition does not identify faces even after scanning hundreds of faces.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Recognition (other bugs)
Version First Reported In: 8.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-16 14:02 UTC by Chad B.
Modified: 2025-07-20 04:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:


Attachments
Debug log of Win11 w/o face recognition (229.73 KB, text/plain)
2025-07-16 18:36 UTC, Chad B.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chad B. 2025-07-16 14:02:18 UTC
SUMMARY
Face recognition does not detect faces after scan and classification of a considerable number of identified faces

STEPS TO REPRODUCE
1.  Scan image library for faces, and wait some time for it to complete
2.  Classify some subset of photos from "unknown" by identifying who the face belongs to
3.  Run the Recognize Faces workflow with any Face Size and Accuracy.
4. Upon completion, which can take just a couple minutes, no faces will be detected, and no faces are moved to Unconfirmed status.

OBSERVED RESULT
After Recognize Faces runs, there are no faces actually classified.  Rebuilding of training data via maintenance does not change outcome.

EXPECTED RESULT
Faces that are known similar to classified faces should move to Unconfirmed for a given individual.

SOFTWARE/OS VERSIONS
Windows: Win 11 24H2
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.3

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2025-07-16 14:26:59 UTC
Face recognition works well under Windows. Currently, there is only one known issue with digiKam versions that already use the new OpenCV-4.12. We need a DebugView log, from the start of digiKam to a face recognition run. DebugView log creation is described here:

https://www.digikam.org/contribute/#windows-host

Maik
Comment 2 Chad B. 2025-07-16 18:36:59 UTC
Created attachment 183287 [details]
Debug log of Win11 w/o face recognition

Debug logs as requested.  Username redacted, but otherwise intact.
Comment 3 Maik Qualmann 2025-07-16 18:42:49 UTC
Okay Thanks, the problem is clear. Your face database "digikam_faces" can't be upgraded to version 6. You're probably using MySQL instead of MariaDB. We're only testing with MariaDB.
This issue has been reported before, but so far no one has sent us a debug log so we can figure out what's going wrong with MySQL.

Maik
Comment 4 Maik Qualmann 2025-07-16 19:05:36 UTC
Git commit 68b8e4afce898fcd8879cd318657f2f0fca2ac0b by Maik Qualmann.
Committed on 16/07/2025 at 19:02.
Pushed by mqualmann into branch 'master'.

use the old function to rename a column
To be compatible with MySQL.

M  +1    -2    core/data/database/dbconfig.xml.cmake.in

https://invent.kde.org/graphics/digikam/-/commit/68b8e4afce898fcd8879cd318657f2f0fca2ac0b
Comment 5 Maik Qualmann 2025-07-16 19:10:30 UTC
Git commit c1af5fe40c203dcfc7a21c2d6427b803887252fb by Maik Qualmann.
Committed on 16/07/2025 at 19:09.
Pushed by mqualmann into branch 'master'.

not change SQLite but MySQL

M  +3    -2    core/data/database/dbconfig.xml.cmake.in

https://invent.kde.org/graphics/digikam/-/commit/c1af5fe40c203dcfc7a21c2d6427b803887252fb
Comment 6 Maik Qualmann 2025-07-16 19:15:50 UTC
Git commit 101052dd6a17dc985e7405bca4ec0854caa5bbd3 by Maik Qualmann.
Committed on 16/07/2025 at 19:14.
Pushed by mqualmann into branch 'master'.

use LONGTEXT with character set utf8

M  +1    -1    core/data/database/dbconfig.xml.cmake.in

https://invent.kde.org/graphics/digikam/-/commit/101052dd6a17dc985e7405bca4ec0854caa5bbd3
Comment 7 Chad B. 2025-07-16 19:22:13 UTC
It's definitely Mariadb:

[root ~]# rpm -qa | grep mariadb
mariadb-backup-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-server-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-connector-c-config-3.1.11-2.el8_3.noarch
mariadb-common-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-gssapi-server-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-connector-c-3.1.11-2.el8_3.x86_64
mariadb-errmsg-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
mariadb-server-utils-10.3.39-1.module_el8.8.0+3609+204d4ab0.x86_64
[root ~]#
Comment 8 Maik Qualmann 2025-07-16 19:25:10 UTC
Yes, the rename function was only available from MariaDB-10.5.2.

Maik
Comment 9 Maik Qualmann 2025-07-16 19:30:58 UTC
I think a new digiKam pre-release version for Windows will be available tomorrow. You can test it from here:

https://files.kde.org/digikam/

I'm sure your face database can be updated then. Please note that the training database will need to be rebuilt.

Maik
Comment 10 Maik Qualmann 2025-07-17 13:56:07 UTC
A new digiKam-8.8.0 pre-release is available, please test it.

https://files.kde.org/digikam/

Maik
Comment 11 Chad B. 2025-07-17 14:37:15 UTC
Installed latest 8.8 version, rebuild training data, and then ran Face Recognize workflow on a small portion of my library and it found at least 197 photos with faces it identified.  I'll now dive into confirming them, etc., but that's 197 more faces than it was finding yesterday in just a subset of my albums. :) 
VERY much appreciate the update, and changes.  Hope it benefits others as well, though I suspect my use of an external MariaDB version may be a fringe use case.