Summary: | 100% CPU usage on all cores for no apparent reason | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | MarcP <iwannaberich> |
Component: | Faces-Engine | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | caulier.gilles, iwannaberich, michael_miller |
Priority: | NOR | ||
Version First Reported In: | 8.7.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Windows Task Manager with all 16 cores at 100% usage |
Description
MarcP
2025-05-13 23:32:29 UTC
Hi, I ran the DebugView to see what was causing that CPU usage. I just started digikam, let it do the initial scan for now files, and didn't touch it at all. High CPU usage kicked in at the 5 minute mark, and stayed that way for another 5 minutes. This is the complete log file. I stopped it at the moment the CPU went back to idle. http://158.101.198.126:9011/share/33RuXex5 The two relevant lines that match the timestamps appear to be these ones: 00001116 683.82061768 [45528] digikam.facesengine: FaceClassifier::loadTrainingData: SVM calcError is: 3.187462 00001117 683.82067871 [45528] digikam.facesengine: FaceClassifier::loadTrainingData: training completed in 338768 ms SVM message come from face engine... The SVN CalcError is just informative about the computation results, it's not a processing error. Code relevant is here : https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/facesengine/recognition/faceclassifier.cpp?ref_type=heads#L378 Gilles Caulier (In reply to caulier.gilles from comment #3) > The SVN CalcError is just informative about the computation results, it's > not a processing error. Code relevant is here : > > https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/facesengine/ > recognition/faceclassifier.cpp?ref_type=heads#L378 > > Gilles Caulier Hi all, Gilles, you are correct. The SVM calcError is shown for debugging purposes. The value reflects the percentage of labels that lie beyond the hyperplane boundry generated by the kernel function for a given label cluster (class) during training. In other words, it's the estimated margin of error for the SVM classifier. This value should always be less than 5.0 (5%). Lower values are better. Cheers, Mike (In reply to MarcP from comment #1) > Hi, > > I ran the DebugView to see what was causing that CPU usage. I just started > digikam, let it do the initial scan for now files, and didn't touch it at > all. > > High CPU usage kicked in at the 5 minute mark, and stayed that way for > another 5 minutes. > > This is the complete log file. I stopped it at the moment the CPU went back > to idle. > http://158.101.198.126:9011/share/33RuXex5 > > The two relevant lines that match the timestamps appear to be these ones: > > 00001116 683.82061768 [45528] digikam.facesengine: > FaceClassifier::loadTrainingData: SVM calcError is: 3.187462 > 00001117 683.82067871 [45528] digikam.facesengine: > FaceClassifier::loadTrainingData: training completed in 338768 ms The concerning line in this backtrace is "FaceClassifier::loadTrainingData: training completed in 338768 ms". This means it took 338 seconds, or over 5 minutes to train the classifier. CPU usage will be high when training the classifier. Training the classifier should take under 60 seconds. How many confirmed faces do you have in your library? Cheers, Mike > How many confirmed faces do you have in your library?
Just checked. 155382 confirmed faces in 1050 different people.
(In reply to MarcP from comment #6) > > How many confirmed faces do you have in your library? > > Just checked. 155382 confirmed faces in 1050 different people. Thanks Marc, I'll see if I can recreate the issue with that many faces, and see if there is a way to tune the classifier training algorithm. I'm almost certain the issue is with training the SVM with that many faces. Cheers, Mike (In reply to Michael Miller from comment #7) > (In reply to MarcP from comment #6) > > > How many confirmed faces do you have in your library? > > > > Just checked. 155382 confirmed faces in 1050 different people. > > Thanks Marc, I'll see if I can recreate the issue with that many faces, and > see if there is a way to tune the classifier training algorithm. I'm almost > certain the issue is with training the SVM with that many faces. > > Cheers, > Mike Hi Marc, Yes, I've confirmed the issue is with training the SVM classifier as part of the overall ensemble of internal classifiers in the face classifier when you have over 100,000 confirmed faces. There's good news and bad news. The good news is the face classifier "falls back" to less efficient approach while the SVM is being trained, so face recognition is usable while it's happening. The bad news is there's no way to fix this without rewriting the entire face classifier. I'll add rewriting the face classifier to eliminate the the SVM classifier to my 8.8.0 to-do list. Cheers, Mike (In reply to Michael Miller from comment #8) > (In reply to Michael Miller from comment #7) > > (In reply to MarcP from comment #6) > > > > How many confirmed faces do you have in your library? > > > > > > Just checked. 155382 confirmed faces in 1050 different people. > > > > Thanks Marc, I'll see if I can recreate the issue with that many faces, and > > see if there is a way to tune the classifier training algorithm. I'm almost > > certain the issue is with training the SVM with that many faces. > > > > Cheers, > > Mike > > Hi Marc, > Yes, I've confirmed the issue is with training the SVM classifier as part of > the overall ensemble of internal classifiers in the face classifier when you > have over 100,000 confirmed faces. > > There's good news and bad news. The good news is the face classifier "falls > back" to less efficient approach while the SVM is being trained, so face > recognition is usable while it's happening. > > The bad news is there's no way to fix this without rewriting the entire face > classifier. I'll add rewriting the face classifier to eliminate the the SVM > classifier to my 8.8.0 to-do list. > > Cheers, > Mike Thanks Michael for looking into it. Let me know when there's any change or you want me to test anything. Hi Michael, Any progress in this file as proposed in comment 8... Best Gilles Git commit e43d260e3950b67cd31c3b93b759147a87210848 by Gilles Caulier. Committed on 14/07/2025 at 18:22. Pushed by cgilles into branch 'master'. by default the scan for face in background option must be disabled, and inplicitly enabled by the users, as this option idle the computer a lot. M +1 -1 core/libs/settings/applicationsettings.cpp M +1 -1 core/libs/settings/applicationsettings_p.h https://invent.kde.org/graphics/digikam/-/commit/e43d260e3950b67cd31c3b93b759147a87210848 diff --git a/core/libs/settings/applicationsettings.cpp b/core/libs/settings/applicationsettings.cpp index c853af8de5..ee91da7977 100644 --- a/core/libs/settings/applicationsettings.cpp +++ b/core/libs/settings/applicationsettings.cpp @@ -230,7 +230,7 @@ void ApplicationSettings::readSettings() d->scrollItemToCenter = group.readEntry(d->configScrollItemToCenterEntry, false); d->showOnlyPersonTagsInPeopleSidebar = group.readEntry(d->configShowOnlyPersonTagsInPeopleSidebarEntry, true); d->detectFacesInNewImages = group.readEntry(d->configDetectFacesInNewImagesEntry, false); - d->faceRecognitionBackgroundScan = group.readEntry(d->configFaceRecognitionBackgroundScanEntry, true); + d->faceRecognitionBackgroundScan = group.readEntry(d->configFaceRecognitionBackgroundScanEntry, false); d->stringComparisonType = (StringComparisonType) group.readEntry(d->configStringComparisonTypeEntry, (int) Natural); diff --git a/core/libs/settings/applicationsettings_p.h b/core/libs/settings/applicationsettings_p.h index 594d62dd46..4caa4fd9c1 100644 --- a/core/libs/settings/applicationsettings_p.h +++ b/core/libs/settings/applicationsettings_p.h @@ -215,7 +215,7 @@ public: bool showOnlyPersonTagsInPeopleSidebar = false; bool detectFacesInNewImages = false; - bool faceRecognitionBackgroundScan = true; + bool faceRecognitionBackgroundScan = false; /// icon view settings bool iconShowName = true; Thanks. Although I must mention that the issue happens regardless that option being enabled or disabled. Created attachment 184387 [details]
Windows Task Manager with all 16 cores at 100% usage
Hi, I was wondering if there has been any update or progress on this issue. It still affects my workflow quite a bit. Thank you for your work! |