Bug 465434 - Problems with face recognition.
Summary: Problems with face recognition.
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Recognition (other bugs)
Version First Reported In: 7.10.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-07 17:56 UTC by Thomas Bach
Modified: 2023-03-20 15:38 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bach 2023-02-07 17:56:06 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

Since weeks, i try to make a face recognition by 10.000 pictures. Some time, it works, but not  as expected, some times, nothing is working. Now, i made a new installation of digikam and imported all pictures from the erlaier sessions (some metadata was written to the picrures). After importing, i have 21 unknown pictures and i dont know, where digikam jhas found theses informations because the databse is new, no recorgnition process was run and i can also not found some informations about unknown pictures in the metadata. 

I try to run a new recognition process with YOLO activated but also, after 2 days, nothing happens. I tried also to uxse the tools/maintanance with deleting the training databse an read all pictures. Same problem.

Is there anywhere a documentation, where the different datas are stored? What is the training database? Is this inside the DB-Schema from digikam itself or is this a seperate file? 

STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2023-02-07 19:20:35 UTC
YOLO is only for face detection, you only need YOLO if you want to recognize very small faces, blurry faces or group photos with many faces. YOLO is much slower.
I can only guess where the 21 unknown faces come from, they must be in the metadata, in digiKam < 8.0.0-Beta1 it could happen that unknown faces were written in the metadata.
First they have to run face detection, they should then have a statistical number of unknown faces depending on the collection. Now enter a name for the unknown persons, there should be at least 5 per person. Now let face recognition run. Now they should have many unconfirmed faces, if correct - then confirm otherwise reject.
Run face recognition again, name other unknown people, etc...
Simply put, the training database is a mapping from face fingerprint to a name.
Therefore, it can always be built up from the already confirmed faces. The rebuild should have done whenever they misconfirmed a lot of faces, changed a lot of names, etc.

Another note: Face recognition currently only works well with faces that have been automatically detected by digiKam. Not with manually drawn face rectangles or faces from other programs, e.g. Picasa.

Maik
Comment 2 Thomas Bach 2023-02-07 19:33:18 UTC
Ok. I understand.

But my problem is, that Face detection is not running correctly. Sometimes, the progress bar stand still by 0% for more than 2 days. Sometimes, the process run in only a few seconcds without detecting new faces.
Comment 3 Thomas Bach 2023-02-07 19:34:48 UTC
And i understand right: YOLO is only for detection of faces in some special conditionsd. Not for the learning of the faces?
Comment 4 Maik Qualmann 2023-02-07 19:38:44 UTC
The problem with the 0% is known under Windows, there is already an attempt to fix the problem. Which digiKam.7.10.0 version are you on exactly (date in file name)? Otherwise please test again with the last one.

Maik
Comment 5 Thomas Bach 2023-02-07 19:44:01 UTC
Sorry Maik,

at the moment, i am installing the 8.0 Beta. I know, that should not done in a production evironment but i have a test system here. Will look what happens and perhaps make a rollback. But by the last try with 7.10 (also with the 0% problem) i had installed the las weeklý update. 
In this environment, by disabling YOLO, the progress bar was already running.
Comment 6 Thomas Bach 2023-02-07 19:47:49 UTC
But if it helps. I tried to view at the processes in this scenario and i could see, that only a few of bytes was written on the journal db.
Comment 7 Maik Qualmann 2023-02-07 19:55:38 UTC
Testing the digiKam-8.0.0-Beta is good. It is important whether the problem with the 0% percent can still be reproduced. I can't reproduce it on my machines, neither here under Linux in a Windows 10 VM, nor on a real 4 CPU machine. I suspect a race condition depending on the speed of the computer. We know from bug 460570 that the images load but then face detection doesn't start.

And yes, YOLO is face detection only.

Maik
Comment 8 Maik Qualmann 2023-02-07 20:55:09 UTC

*** This bug has been marked as a duplicate of bug 460570 ***
Comment 9 Thomas Bach 2023-02-08 08:56:57 UTC
Also with 8.0 beta, the scanning process is stopping. Disabling YOLO has no effect. After disabling using all kernels, the process works. Will try to reproduce this.
Comment 10 caulier.gilles 2023-03-20 15:38:11 UTC
Fixed with #460570