Bug 463297 - face tags not loaded when mysql deleted and import again
Summary: face tags not loaded when mysql deleted and import again
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Faces-Workflow (other bugs)
Version First Reported In: 7.9.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-21 06:13 UTC by Petr Schonmann
Modified: 2023-05-03 11:25 UTC (History)
2 users (show)

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


Attachments
missing face regions even tags are present (682.18 KB, image/png)
2022-12-21 06:13 UTC, Petr Schonmann
Details
Original photo (148.27 KB, image/jpeg)
2022-12-21 13:47 UTC, Petr Schonmann
Details
Tags read order (67.78 KB, image/jpeg)
2022-12-21 14:00 UTC, Petr Schonmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Schonmann 2022-12-21 06:13:29 UTC
Created attachment 154722 [details]
missing face regions even tags are present

SUMMARY
***
Ive sync all metadata from database into files and deleted whole mysql database digikam. When loaded photos with face i see that face tag is applied, but cant see regions when clicking on button "Show face tags" and there is region thats allow me tag face as unknown.
***


STEPS TO REPRODUCE
1. Create some collection of photos with mysql database
2. Edit some tags, face tags, write them all into files
3. Delete whole mysql db and create one
4. Rescan all photos


OBSERVED RESULT
No face tags regions in image displayed, even face tags are checked, see image

EXPECTED RESULT
Face tags "paired" like before mysqldb deleted and library rescanned. Im not able to do recognize faces, because no face is confirmed

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Appimage on Linux mint

KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7

ADDITIONAL INFORMATION
diigkamrc config - https://share.schonmann.eu/ozx1nu.txt
Comment 1 Maik Qualmann 2022-12-21 07:29:25 UTC
A test here with digiKam-8.0.0 I cannot reproduce the problem described. Much has been changed in writing and reading face metadata in the upcoming digiKam version. Can you provide the image in question for testing to see if the metadata was written correctly or if the problem occurs when reading it? You can also, if not publicly, send it to my email.

Maik
Comment 2 Petr Schonmann 2022-12-21 13:47:35 UTC
Created attachment 154726 [details]
Original photo
Comment 3 Petr Schonmann 2022-12-21 13:59:22 UTC
Tried to download appimage digikam v8beta1 but nothing changes.
Added original photo.

Probably related to ticket where we were fixing tags https://bugs.kde.org/show_bug.cgi?id=459370

Im attaching screenshot of digikam settings where is displayer order of reading tags.
Comment 4 Petr Schonmann 2022-12-21 14:00:30 UTC
Created attachment 154727 [details]
Tags read order
Comment 5 Maik Qualmann 2022-12-21 16:19:07 UTC
I've only tested it briefly with the Windows version and with SQLite, the face is assigned the confirmed name, so ok so far. I'll test it tonight with MySQL.
But to another general problem. With these tags settings, the tags tree cannot be restored. XMP.dc.subject is completely unsuitable for this as metadata that is read first. It doesn't save a path, so your tags tree will be unrecoverable.

Maik
Comment 6 Maik Qualmann 2022-12-22 07:28:41 UTC
Git commit d8fa3a019f52175d33425609c72116a82557f26d by Maik Qualmann.
Committed on 22/12/2022 at 07:25.
Pushed by mqualmann into branch 'master'.

skip face detection if enabled when newly added images already have faces

M  +1    -1    core/app/main/digikamapp_tools.cpp

https://invent.kde.org/graphics/digikam/commit/d8fa3a019f52175d33425609c72116a82557f26d
Comment 7 Maik Qualmann 2022-12-22 12:26:53 UTC
I cannot reproduce the problem, the face rectangle is always with a confirmed name. What strikes me that the face rectangle is much larger here, as on your screenshot. With your screenshot, I would assume that face detection was executed. The test image is really that on your screenshot? How do you delete the MySQL database?

Maik
Comment 8 Petr Schonmann 2022-12-22 16:27:16 UTC
I cannot reproduce the problem, the face rectangle is always with a confirmed name. What strikes me that the face rectangle is much larger here, as on your screenshot.
--- Ive tried to zoomout to max level. Cant see bigger rectangle than picture.

With your screenshot, I would assume that face detection was executed.
--- Yes, ive rescaned whole library when i deleted mysql database

The test image is really that on your screenshot?
--- Yes, its 1:1

How do you delete the MySQL database?
--- DROP database digikam; then  CREATE database digikam;

But to another general problem. With these tags settings, the tags tree cannot be restored. XMP.dc.subject is completely unsuitable for this as metadata that is read first. It doesn't save a path, so your tags tree will be unrecoverable.
--- What do you suggest ? Or just send me a link how to setup. I have photos on Synology NAS and using Synology photos app to share photos. I need to have tags readable by Synology photos and digikam and perfectly synced because im using smart albums where faces are used :)
Comment 9 Maik Qualmann 2022-12-23 12:25:12 UTC
If you perform face detection again with the option to clean everything and scan again, it is normal that you now have an unknown name for your face region. The previous information will not and cannot be used for face recognition (larger area of face rectangle.)

To exchange tags between different programs, in the digiKam extended metadata data for tags, you need to put an entry in the first position that is supported by the third-party program and contains a tags path.
XMP.dc.subject is not suitable for this, try XMP.lr.hierarchicalSubject.

Maik
Comment 10 Petr Schonmann 2023-01-13 09:48:35 UTC
Thanks for clarification, i moved up XMP.lr.hierarchicalSubject
Comment 11 caulier.gilles 2023-05-03 02:21:33 UTC
@Petr Schonmann

digiKam 8.0.0 is out. This entry still valid with this release ?

Best regards

Gilles Caulier
Comment 12 Petr Schonmann 2023-05-03 08:18:26 UTC
You can close the ticket, its clarified by  Maik Qualmann 2022-12-23 12:25:12 UTC