Import people, faces and other metadata used in Digikam

Started by prorokrak, September 24, 2025, 08:07:47 PM

Previous topic - Next topic

prorokrak

Hi, recently I stumbled upon IMatch and decided to try it. Until now, I have used Digikam, and was relatively satisfied. One thing I have used extensively, was face detection/recognition. I have few hundreds of people tagged, and around 25 000 faces confirmed (with some 75 000 still to go). I wanted to try IMatch to see whether it would be better for the job.

I would like to try the People functionality in IMatch without re-doing the work, so I need to import the faces and people confirmed in Digikam to IMatch database. I really tried to do my homework, and went through multiple sources on how to achieve that:
https://www.photools.com/help/imatch/people.htm
https://www.photools.com/community/index.php/topic,14616.0.html
https://www.photools.com/community/index.php/topic,14626.0.html
and several others.

Still, the amount of information is overwhelming and I was not able to import the faces, and importantly, people names, into IMatch.

Here is my current setup:
  • I have saved face/people info into XMP sidecar files, not into the original picture files. (For the datetime and location, I tried to save the changes both into the original file and XMP as well.) In other words, my metadata in original file and XMP sidecar may not be in sync as described here https://www.photools.com/help/imatch/md_writeback.htm. The idea was not to edit the original files, and save the changes only to sidecar. Now I see that probably was not the best thing to do.
  • For images, I have set option "Do not update file modification timestamp when files are modified" in Digikam. (After reading https://www.photools.com/help/imatch/how-imatch-uses-date-and-time.htm?dl=hid-1 I may reconsider this in the future.)
  • I can see the face information, including people names, is saved in MP:RegionInfo and mwg-rs:Regions of XMP file.

However, when I imported the pictures into IMatch, faces and people were not imported.
I have checked "Preferences > Metadata 2 > Import IPTC PersonInImage" option and did CTRL+SHIFT+F5 "Force Update" but no success which is not surprising since the face metadata are not in such tag.


In addition, I would like to "map" some metadata set in Digikam into appropriate metadata tags in IMatch. For example, there are xmp:Label (or the same info in namespace digiKam:ColorLabel), xmp:Rating, xmpDM:pick (or digiKam:PickLabel) fields in my XMP file. I want them to be imported to IMatch collections. For example, xmp:Label/digiKam:ColorLabel should be mapped to IMatch Label, xmp:Rating to IMatch Rating, xmpDM:pick/digiKam:PickLabel to IMatch Pins or Dots.

Of course, the fields may not be possible map one-to-one. For example, in xmp:Labels I may have color "Purple" while IMatch does not have such label. (Preferable, IMatch would create non-existent labels.) Rating may be from 0-5 (6 states), while IMatch has 7 states (1-5, None, Reject).
Is such mapping somehow achievable in IMatch? (Somehow with Metadata Mechanic? Or Metadata Templates? Variables?)

Also, when I tried to adjust collection tags in IMatch and then I wrote-back metadata into the file, I could not see where these metadata was saved in XMP sidecar. So I could not find out which fields IMatch uses to store the information (in case I would like to use them back in Digikam).

Ideally, I would like to import as much metadata as possible from the original files and sidecars and then save everything properly to clean the current mess.

Attached, you can find a sample file together with its XMP sidecar which contains face regions and tags and also other metadata mentioned here. There is also JSON from Metadata Analyst tool.

Any help will be really appreciated.

(The image is too large to attach.)
https://drive.google.com/file/d/1AzN-2ohRvHcakfsFxxd8K7Wa5vbCJP3m/view?usp=sharing

Mario

JPG is defined as to use embedded XMP metadata.
XMP files are supposed to have the same name as the corresponding image file, with the extension .XMP replacing the extension of the file. Foo.RAW => Foo.XMP. This is what IMatch expects.

The provided JPG file has an embedded XMP record, mostly a mapping of many EXIF tags, a proprietary DigiKam color label (instead of the official XMP color label) and two Photoshop tags.

The JPG file you have provided shows quite a number of issues in the Metadata Analyst, from missing time stamps to out-of-sync keywords.

Then there is an external XMP file, which uses the name 2025-06-18 12-33-33 MB_v1.jpg.xmp.txt, which means it will not be discovered by IMatch. Even if it would be discovered (after renaming it to 2025-06-18 12-33-33 MB_v1.xmp) IMatch would ignore it since JPG files contain embedded XMP metadata.

I think the best way of action is to use ExifTool to copy the data from the txt files into the JPG files, merging the external XMP data with the embedded XMP data.

I've used this command to do that for an entire folder:

"C:\Program Files\photools.com\imatch6\exiftool.exe" -v -ext JPG -tagsfromfile %d%f.jpg.xmp -all:all -r c:\images\test

NOTE: ExifTool did nothing except output a warning until I removed the .txt extension so the files ended in .xmp (not sure why).

c:\images\test is the folder to process.

Afterwards, select the mages in the folder in IMatch and press Shift+Ctrl+F5 > Reload Metadata. This overrides the data in the database which might be protected otherwise and IMatch replaces what is cached with the updated XMP metadata from the JPG files. This brings in the labels, face annotations, keywords etc.

I then did a write-back, which caused the XMP CreateDate to remain pending (pen still visible in the File Window).
I looked at the CreateDate in the Metadata Panel and the date is invalid:

2025:06:18+00:00+02:00

(The +02:00 is my local time zone, you might see something different).
The error is in the time, which has no seconds, and is separated from the data with a + instead of a space.
Not sure why. I see that the timestamp in the file has no time section, only a date. Maybe something goes wrong during the conversion during the import. Not sure. I'll have to check in IMatch.

Anyway, after fixing the CreateDate in the Metadata Panel (replace + with a space and adding the missing seconds), the next write back sorts everything out. Only some minor warnings in the Metadata Analyst which can be ignored.

After verifying that everything worked, you can delete the .jpg.xmp files and the .original files ExifTool creates.
Give it a try with a folder with images. Make backups before etc.

prorokrak

Thank you, Mario, for the answer. Unfortunately, I have not noticed it was answered because I waited for an e-mail notification (without checking forum settings whether it is set to be sent).

As for the txt extension, I have added it because upload form would not let me upload xmp files. In my folders, there is of course no txt extension.

Quote from: Mario on September 25, 2025, 10:56:27 AMXMP files are supposed to have the same name as the corresponding image file, with the extension .XMP replacing the extension of the file. Foo.RAW => Foo.XMP. This is what IMatch expects.

This one surprised me, I understood it that having .jpg.xmp is better/more preferable/more common since if there are several images in the folder, like .jpg, .tiff, .dng, each of them may have its own xmp sidecar file.

Not sure why there were issues with CreateDate, since the tag seems to have time including seconds.

Anyway, now when I have found your answer I can continue with trying the suggested solutions. I will get back with what I found.

Mario

QuoteThis one surprised me,
I orient myself at what Adobe and the large DAM and publishing houses do. Call it an "industry standard".
IMatch works this way since version 3, more than a decade ago. I think only Digikam appends .xmp to the full file name...not sure.