Bug 338785 - digiKam face detection finds no faces
Summary: digiKam face detection finds no faces
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Detection (show other bugs)
Version: 4.6.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-03 18:50 UTC by Jens
Modified: 2017-07-26 17:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2014-09-03 18:50:58 UTC
I installed Digikam 4.2.0 on Ubuntu 14.04 (PPA) and also compiled it by myself using MacPorts on OS X. On both systems, using a fresh install, with different libraries, when I select the face detection tool, no matter which options I select, it will finish in 0:00 seconds and find no faces at all.

Reproducible: Always

Steps to Reproduce:
1. Install digikam. During installation, select a folder as album root which contains photos of several people.
2. Select faces tab.
3. Search for faces (deleting and recreating any previous face database).
4. Click OK.

Actual Results:  
No faces are found.

Expected Results:  
Faces should be detected and displayed.
Comment 1 caulier.gilles 2014-09-03 21:45:06 UTC
Jens,

I use MACOSX here with macports, and all work fine about face detection.

Sound like something is missing on your computer from OpenCV library.

Please turn on libkface debug space using kdebugdialog as explained here :

https://www.digikam.org/contrib

...and run digiKam from a console to get debug trace when you run face detection. Report trace here...

Gilles Caulier
Comment 2 Jens 2014-09-13 09:53:38 UTC
I did as you said:
- turned on KFACE debug (51005 or something)
- started digicam from a console
- went to the faces sidebar
- clicked on "Search for faces"
- selected "detect and recognize" and "delete old training data" in the options
- clicked OK
- At once I got a small popup window saying the operation is completed and took 00:00:00 seconds.
- Also in the "My Tags" sidebar below the face detection button there are no tags, although my photos have lots of tags already.

Here is the console output. I don't see anything suspicious except for
" digikam(1098)/KIPI (general): Current image collection is not valid.  ". What does that mean?

jens@linuxkiste:~$ digikam
Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath)
QSqlDatabasePrivate::removeDatabase: connection 'ConnectionTest' is still in use, all queries will cease to work.
digikam(1098)/KFACE KFaceIface::SchemaUpdater::startUpdates: Have a database structure version  "2"
digikam(1098)/KIPI (general): Current image collection is not valid. 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core): Untreated temporary search type  0 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 
digikam(1098)/KIPI (general): Current image collection is not valid. 
digikam(1098)/digikam (core) Digikam::ThumbnailCreator::createThumbnail: Cannot create thumbnail for  "/run/user/1000/gvfs/smb-share:server=..../2014-06-09 IMG_4756.mp4" 
digikam(1098)/digikam (core) Digikam::ThumbnailCreator::load: Thumbnail is null for  "/run/user/1000/gvfs/smb-share:server=..../2014-06-09 IMG_4756.mp4" 
digikam(1098)/digikam (core) Digikam::ThumbnailCreator::createThumbnail: Cannot create thumbnail for  "/run/user/1000/gvfs/smb-share:server=..../2014-09-06 P1110766.mp4" 
digikam(1098)/digikam (core) Digikam::ThumbnailCreator::load: Thumbnail is null for  "/run/user/1000/gvfs/smb-share:server=..../2014-09-06 P1110766.mp4" 
.....
Comment 3 caulier.gilles 2014-09-13 10:17:42 UTC
Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked
database file. There is an active transaction. Waited but giving up now.

==> your database is locked. Why ? Did you have 2 digiKam instance started. Did you have anther process which open digiKam DB file before digiKam instance (there are few DLNA  tool which do it automatically).

digikam(1098)/digikam (core) Digikam::ThumbnailCreator::load: Thumbnail is null for  "/run/user/1000/gvfs/smb-share:server=..../2014-06-09 IMG_4756.mp4" 

==> you use a shared collection through Samba FS. Please try first with a local collection

" digikam(1098)/KIPI (general): Current image collection is not valid.  ". What does that mean?

==> Don't care. It's not relevant of face management.

Gilles Caulier
Comment 4 Jens 2014-09-13 20:09:04 UTC
I just installed digikam using the Ubuntu 14.04 PPA, no additional tools that use the digikam db.

I also tried with local pictures (actually I have a local images directory added as album in addition to the remote one), same result.

What else can I try?
Comment 5 caulier.gilles 2014-09-25 06:44:52 UTC
The face detection is relevant of OPenCV library. Are you sure that all components are installed on your computer ?

In your first trace i can see :

digikam(1098)/digikam (core) Digikam::DatabaseCoreBackendPrivate::checkRetrySQLiteLockError: Detected locked database file. There is an active transaction. Waited but giving up now. 

It's clear here that database file is locked. By what ? I don't know...

I remember in a past, an application which share through UPNP digiKam collection on the network. This stand alone application (a service, i sdon't remeber the name) open digiKam DB file. In this case digiKam cannot write something in... File is in read only.

Gilles Caulier
Comment 6 caulier.gilles 2014-09-30 05:31:51 UTC
Jens,

Look if this file is not relevant of this bug 

https://bugs.kde.org/show_bug.cgi?id=337507

... where Pino Toscano has found a problem with OpenCV Haar cascade files path.

Gilles Caulier
Comment 7 Jens 2014-11-27 18:07:41 UTC
Hi,
I just installed KDE 4.14 with digikam 4.5.0 and still have the same problem. During face detection there is no debug output of KFACE (51005) at all. I have used a local library (some local images) and the database is not locked (no lock error message).

I installed "opencv-data" to get the haarcascade files, symlinked the haarcascade directory into "$HOME/.kde/share/apps/libkface/" and restarted digikam with debugging for "digikam" enabled too. When running the face detection I get this in the console:

digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false true
digikam(21591)/digikam (core) Digikam::FacePipeline::Private::checkFinished: Check for finish:  0 packages, 0 infos to filter, hasFinished() true
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false false
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false true
digikam(21591)/digikam (core) Digikam::FacePipeline::Private::checkFinished: Check for finish:  0 packages, 0 infos to filter, hasFinished() true
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false false
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false true
digikam(21591)/digikam (core) Digikam::FacePipeline::Private::checkFinished: Check for finish:  0 packages, 0 infos to filter, hasFinished() true
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false false
digikam(21591)/digikam (core) Digikam::FaceDetector::slotContinueAlbumListing: false true

Still no faces are found and the process finishes in one second.
I'm out of ideas. Anything I missed?

Thanks!
Comment 8 caulier.gilles 2014-12-02 14:16:27 UTC
Go to help/Components Info dialog to check :

- libkface version.
- OpenCV version.

Libkface is not integrated with KDEGraphics/libs (it's done for next releases)
I seen libkface is compiled and installed as separated package by default on  my distro (Mageia). This version is an older one, and do not include all recent fixes done since recent digiKam release (4.3, 4.4, 4.5).

Gilles Caulier
Comment 9 Jens 2014-12-02 22:43:54 UTC
libkface according to dpkg is "1.0-digikam4.5.0-trusty-ppa1kde414" (from digikam 4.5 Ubuntu PPA). 
libkface according to Digikam is "3.5.0" (is this the API version?)

libopencv according to dpkg is 2.4.8+dfsg1-2ubuntu1.
libopencv according to Digikam is 2.4.9 (probably updated by ubuntu).
Comment 10 Jens 2014-12-02 22:44:42 UTC
this is the PPA: https://launchpad.net/~philip5/+archive/ubuntu/extra
Comment 11 Jens 2015-01-08 10:20:21 UTC
This was solved by reinstalling Ubuntu (without KDE) and installing the `libopencv-photo2.4` package which provides `libopencv_photo.so`. After this, faces on **local** pictures are detected. Unfortunately, the digikam package does not depend on `libopencv-photo2.4`, so this wasn't solved automatically.

However, faces on remote albums (SMB share in my case) aren't detected although the share is mounted and the images are accessible. Is this intentional, not yet implemented or can it also be considered a bug?
Comment 12 Jens 2015-01-08 10:20:43 UTC
PS: I'm on digikam 4.6, in the mean time.
Comment 13 caulier.gilles 2015-01-09 09:31:56 UTC
>This was solved by reinstalling Ubuntu (without KDE) and installing the `libopencv->photo2.4` package which provides `libopencv_photo.so`. After this, faces on **local** >pictures are detected. Unfortunately, the digikam package does not depend on >`libopencv-photo2.4`, so this wasn't solved automatically.

This is typically a packager problem, not a digiKam/libkface problem. Please report this problem to your distro team.

Note : OpenCV is a big puzzle (weird puzzle). Packager must take a care about packaging a linking rules set on client system.

>However, faces on remote albums (SMB share in my case) aren't detected although the >share is mounted and the images are accessible. Is this intentional, not yet implemented >or can it also be considered a bug?

We have never tested with remote collection through the network.

If device is mounted in local on your system with good access right, this must work as expected.

Gilles Caulier
Comment 14 Jens 2015-01-11 21:48:55 UTC
> We have never tested with remote collection through the network.

Please do. It is weird, sometimes it works, sometimes no images are found. Also there are strange delays when viewing images (sometimes digikam freezes completely for 20 seconds with no network activity).