Bug 406971

Summary: Face frames are misaligned on Digikam when face framing was done on Picasa.
Product: [Applications] digikam Reporter: Alexandre Belz <alexandre.belz>
Component: Faces-EngineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version: 6.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 7.0.0
Sentry Crash Report:

Description Alexandre Belz 2019-04-27 13:56:04 UTC
SUMMARY
I've migrated from Picasa to Digikam. 
I can see errors on Digikam when showing the face framing done on Picasa.

STEPS TO REPRODUCE
1. Open the picture enclosed DSCN6711.jpg
2. Display the faces in Picasa. Every face frame is aligned. See screen capture.
3. Display the faces in Digikam. Every face frame is misaligned. See screen capture.

OBSERVED RESULT
Face frame are misaligned in Digikam compared to previous & correct alignement from Picasa.


EXPECTED RESULT
Face framing should be the same in Picasa and Digikam.

SOFTWARE/OS VERSIONS
Windows: 10

ADDITIONAL INFORMATION
Comment 1 Alexandre Belz 2019-04-27 14:03:34 UTC
Pictures can be found in shared OneDrive directory :
https://1drv.ms/f/s!Ahp2yXCYf8WmiSo3YhhZR8gPc1fs
... with also the Picasa context file.
Comment 2 caulier.gilles 2019-04-27 14:09:41 UTC
Can you reproduce the dysfunction with last digiKam 6.1.0 Linux AppImage bundle ?
Gilles Caulier
Comment 3 Maik Qualmann 2019-04-27 15:14:52 UTC

*** This bug has been marked as a duplicate of bug 372340 ***
Comment 4 Alexandre Belz 2019-04-28 06:57:47 UTC
Thank you @gilles, I'm upgrading to 6.1.0 (on windows) and trying again...
Comment 5 Alexandre Belz 2019-04-28 07:20:18 UTC
Hi, the issue is still present running 6.1.0 for windows.
See picture enclosed.
Comment 6 Alexandre Belz 2019-04-28 07:24:58 UTC
Hello Gilles, I can still see the issue running 6.1.0
https://1drv.ms/u/s!Ahp2yXCYf8WmiS9-MNPvREJbFzWz
Comment 7 Maik Qualmann 2019-04-28 07:26:46 UTC
This problem (bug 372340) is extensive, because for all long-standing digiKam users a conversion of the facial areas has to be written in the database.

Maik
Comment 8 Alexandre Belz 2019-04-28 18:57:05 UTC
I don't understand your comment Maik, sorry.

Anyway, I've found a reason of that bug : the picture was edited in Picasa BUT NOT SAVED BY PICASA. I noticed that the faces position were misaligned AND ROTATED, and this gave me the trick.
I went back in Picasa and noticed that modifications done in the past were NOT saved in Picasa. So I guess that the Picasa database was OK, but not applied to the JPG picture itself.

Now that the picture is saved, I went back to Digikam 6.1.0
it's better : the faces are now well located... but they are twice more numerous ! 
* See screen capture : 406971_2019-04-28_1.png
* and new JPG saved by Picasa : DSCN6711_saved.JPG
Comment 9 Maik Qualmann 2019-04-28 20:29:16 UTC
The problem is clear. Picasa and the the standard is that the face regions are saved to a non-aligned image. The implementation in digiKam has been storing the face regions for the aligned image for years. We will change it, but we need to convert the database and the stored face regions in the users' images. That will be a bigger deal.
So you can not currently swap face region images between digiKam and Picasa.

Maik
Comment 10 Alexandre Belz 2019-04-29 07:09:14 UTC
OK Maik, thank you ! :)
That explains why the face tags where wrong, but I don't understand why now I have duplication of them in my sample jpg.

Depending of what files digiKam read to get the face frames (in the JPG or in another database), please can you advise a procedure for me to have face frames correctly imported from Picasa to digiKam, avoiding any duplication ?
I can't manually check my thousands of pictures... :)

For instance, we could have :
1. "Save all" pictures edited in Picasa (to align face information)
2. Should I uninstall Picasa to erase its central database ?
3. Should I uninstall digiKam to erase any central database ?
4. Reinstall digiKam ?

please review/correct this procedure as it should be.
Many thanks for your great help !
Comment 11 caulier.gilles 2019-12-23 15:08:19 UTC
7.0.0-beta1 is out with new Face Recognition algorithm based on Deep
Learning/Neural Network API from OpenCV

https://download.kde.org/unstable/digikam/

Please test and give us a feedback

Thanks in advance
Gilles Caulier
Comment 12 Alexandre Belz 2019-12-24 10:46:27 UTC
Super ! 

7.0 beta1 downloaded, will test these days !

i understand that new Learning Neural network is implemented, but what about legacy Picasa rotated pictures with Faces ?

Alex
Comment 13 caulier.gilles 2020-01-19 08:51:38 UTC
Git commit 32bb16fee6b2676b30bf843bf3e083a23084cd3d by Maik Qualmann.
Committed on 19/01/2020 at 08:37.
Pushed by mqualmann into branch 'master'.

read and write not aligned face metadata from image
FIXED-IN: 7.0.0

M  +2    -1    NEWS
M  +7    -4    core/libs/database/item/scanner/itemscanner_photo.cpp
M  +3    -29   core/libs/fileactionmanager/metadatahub.cpp
M  +0    -6    core/libs/fileactionmanager/metadatahub.h
M  +6    -5    core/utilities/imageeditor/main/imagewindow.cpp

https://invent.kde.org/kde/digikam/commit/32bb16fee6b2676b30bf843bf3e083a23084cd3d