How to do face detection in digiKam and import them into IMatch?

Started by ChicagoGhost, October 18, 2024, 05:21:46 AM

Previous topic - Next topic

ChicagoGhost

I tried face detection in IMatch with 1000~2000 photos. Many faces are not detected, especially for photos with many people, in which the faces are small. Adding face annotations to them one by one is really a tedious job. And there are 150K photos waiting for me to do this.
Using the YOLO v3 model in digiKam, a higher percentage of the faces can be detected, saving me a lot of work.

So I would like to use the face detection function in digiKam and then import them into IMatch.

First, is this a good idea? I don't know whether digiKam will mess up IMatch's photo directory, or mess up the metadata IMatch has written to the photos.

Second, I can't make it work. In digiKam, I have checked "Face Tags" in settings-metadata-behavior. I have run the command from menu: Album-Write metadata to files. In IMatch, I can't see the face annotations. I used the command-Add or update folders. I even created a new database from those photos.

mastodon

Check whether Digikam saves the face tags in the jpg file. If it does not, just in its database, IMatch can't read it.

Mario

See Working with XMP Face Regions in the IMatch help.
Works with Adobe face regions, Apple face regions, Google face regions. If DigiKam stores and maintains XMP face regions, it will also work with DigiKam.

QuoteI used the command-Add or update folders.
This is not required. When DigiKam updates XMP metadata in your images or sidecar files, IMatch recognizes this automatically and rescans the file.

Tip: Look at an image in the ExifTool Command Processor. Run the "List Metadata" preset and search for region. If DigiKam has written the face regions as XMP regions with tags, this is how you find them.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig

Just also wanted to quickly try digiKam and their face recognition tool, but after importing 16 (!) pictures (jpg) and running the face detection / face recognition, digiKam crashed. Not sure if I want to rely on such a software. Maybe it is more stable on Linux or maybe it is just my Computer, but my start was not that promising.

mastodon

Digikam is really promising at first, but overhalming interface and crashing.

ChicagoGhost

Quote from: axel.hennig on October 18, 2024, 09:09:45 AMNot sure if I want to rely on such a software.
After a few days of trying, I think it's not a good idea to rely on it. There are many bugs. And, from the function point of view, it is not comparable to IMatch. IMatch is much more powerful. The main reason that some people like Digikam is that it is free.
However, since face recognition has an option to use the YOLO v3 model, the result is pretty good.

Mario

But it does not export the face regions to XMP to make them available for other software?

I have never used DigiKam since I have a proper DAM already ;)  so I cannot really provide any insights.

On their help page they write:

QuoteFace Tags (including face areas): will store the face tag paths and the rectangles corresponding to the zones around faces. Usually this information is stored in XMP.
which sounds promising!? Maybe just a switch to enable?

Quotean option to use the YOLO v3 model,
I have worked with the Yolo 3 (which is around for a while) and it's predecessors in OpenCV etc.
Results were mixed. Sometimes IMatch was better, sometimes the Yolo model. Maybe your use case is special. Maybe you have not trained IMatch correctly yet?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ChicagoGhost

Quote from: Mario on October 18, 2024, 12:22:43 PMwhich sounds promising!? Maybe just a switch to enable?


I got it working. Before confirming the faces, Digikam doesn't write the face recognition results to the file. After I confirmed, they were written and I could see them in IMatch.

But, a big problem arises:
It looks like Digikam somehow corrupted most of the files.
1. In IMatch, when using ExifTool Command Processor, it shows an ExifTool error.
2. IMatch says: there was an error while writing back metadata to this file.
3. Those files don't show face annotations in IMatch.

So, I have come to the conclusion that Digikam is not reliable, even just using it as a face recognition tool.
I am going to stay away from it.

Mario

QuoteIt looks like Digikam somehow corrupted most of the files.
Uh-oh, that's bad. I thought DigiKam was using ExifTool to read and write metadata?
And ExifTool is solid, IMatch uses it since IMatch 5 back in 2016.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig


Mario

Thought so. More info needed on the damage effects and the actual ExifTool error message.
Error messages may be shown for many reasons.
Maybe run the Metadata Analyst in IMatch on one of the problem files.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook