How to stop metadata writeback of *unconfirmed* faces?

Started by davebulow, February 11, 2025, 01:43:18 PM

Previous topic - Next topic

davebulow

Hello,
I've searched through help docs and forum but couldn't find my answer. Sorry if I missed it. If it's there, please feel free to let me know.

Excellent software. I'm very impressed. I just have one query.

I like to do metadata writeback in order to share files with others. This includes face annotations. However, I've noticed that writeback always includes unconfirmed faces, which is something I definitely don't want (mainly because it can get the wrong person and I don't want that wrong data returned to the JPEG file). Is there any way to stop IMatch doing this?

I assume I could delete all unconfirmed faces from the database within IMatch then do write-back, then re-find faces later, but that's not something I want to do every time, as I have hundreds of thousands of photos, and I'm still working my way through them all!  :)

Thanks in advance, and thanks for this excellent software!

Mario

IMatch does not differentiate between confirmed and non-confirmed face annotations when it writes back the regions into XMP to persist the data safely in your images. There are no concepts for confirmed / unconfirmed tags in XMP face regions either.

If IMatch would only write partial (aka confirmed face regions) this could be led to problems or even data loss when re-importing the files after they have been modified externally or importing them into another database.
If a face has XMP regions, IMatch imports them, but does not run additional face recognition. Same for other software that can import face regions.

Exporting metadata for a file with 1 confirmed and e.g. 2 unconfirmed faces would result in the image with only one face region. Not good.

If you have to write-back to images before you can assign the correct person, deleting face annotations with the corresponding command in the File Window context menu is probably best.

davebulow

#2
Hi Mario,
Thank you so much for the quick reply!

Thanks for explaining all of this, too. I think I understand what's happening now. It makes a lot of sense.

I'm assuming then, based on what you say about XMP having no concept of confirmed/unconfirmed, that when IMatch notices changes in an external file, if it already has that file in its database with face annotations, it uses the IMatch database face data in preference to the XMP data?

At the moment, if I have an image with 1 confirmed face and 1 unconfirmed (but assigned to the wrong person by Imatch), and I do writeback, it's writing 1 false name into the file. Surely in some ways this is worse than having no region in the XMP data, since other software will not know which face is true and which was a (wrong) guess, and if something happened to the IMatch database, it also would load face regions from the file and assign "confirmed" wrong names?

I can only think of 2 possible ways this could be solved. (Given my very limited understanding of the subject)

1. Write unconfirmed faces with a predefined string that IMatch always recognises on import and knows is an unconfirmed face, e.g. "UNKNOWNFACE", and then if it sees this string when reading XMP data, it uses its own database if available, or if not in the database, knows it's a face region but doesn't assign a person to the face. In my opinion this would be preferable to telling other software the wrong person's name.

2. Perhaps a setting in Imatch that is off my default, but if turned on, does 2 things to Imatch's behaviour:
    i. Assumes that Imatch is the 'master' of all face regions, and therefore disables *reading* face region data from XMP.
    ii. Only writes confirmed faces, and writes no XMP tags as face regions.

(This second option would be suited to those who use IMatch as their sole face recognition software).

These are just ideas and I totally appreciate you are busy with a lot of other work, and you know the inner workings of IMatch, and I don't! So I obviously bow to your expertise!  :)

Thanks again for all your help and work!

DaveBülow

Mario

Quoteit uses the IMatch database face data in preference to the XMP data?
Yes. Unless a forced rescan or metadata reload is requested.
If a file already has face annotations in the database, IMatch does not import face regions again.
See Working with XMP Face Regions

Quote2. Perhaps a setting i

IMatch has so many settings already, adding more settings to support your peculiar use case would probably only add confusion. Generally, I try to reduce the number of options, since users often complain about the "complexity".

Face regions work the way they work since face recognition was introduced to IMatch many years ago. It seems to work just fine for the majority of users.

I would not write-back files containing false (as per your statement) person assignments. Set the correct person or remove the face annotation, then write back.
This would be the same as writing back known wrong metadata before exchanging your files with others. Not a good workflow.

Finish the file (complete metadata, finish face recognition etc.) before exchanging files with others. That's what I would suggest.

davebulow

Mario
Thank you again for taking time to explain all this. I understand and will try to do as you suggest in future. It's just tricky with so many files. Thanks again for considering this. I'm sure your explanations will help others in future if they have similar questions.
Best regards
Dave

davebulow

So sorry, Mario. Just one further question based on looking at some files on my PC:

The following metadata was written by Imatch, I assume. It's exactly what I was hoping for, except for unconfirmed faces.

This file (in the Imatch database) has a confirmed face:

     <rdf:li rdf:parseType='Resource'>
      <mwg-rs:Area rdf:parseType='Resource'>
       <stArea:h>0.224888</stArea:h>
       <stArea:unit>normalized</stArea:unit>
       <stArea:w>0.150000</stArea:w>
       <stArea:x>0.435000</stArea:x>
       <stArea:y>0.652174</stArea:y>
      </mwg-rs:Area>
      <mwg-rs:Name>The Person's Name was here</mwg-rs:Name>
      <mwg-rs:Type>Face</mwg-rs:Type>
     </rdf:li>

This second file contained a face, but Imatch has not written a name. The face area exists, but could not be matched to a person by Imatch, so it remained as an "unknown person". It's therefore been written to metadata without a name. Is there any way that I can make exactly this happen but for unconfirmed faces?

     <rdf:li rdf:parseType='Resource'>
      <mwg-rs:Area rdf:parseType='Resource'>
       <stArea:h>0.642000</stArea:h>
       <stArea:unit>normalized</stArea:unit>
       <stArea:w>0.808096</stArea:w>
       <stArea:x>0.595952</stArea:x>
       <stArea:y>0.520000</stArea:y>
      </mwg-rs:Area>
      <mwg-rs:Type>Face</mwg-rs:Type>
     </rdf:li>

Sorry, if the answer is no, then it can't be helped, but I just had to ask.  :D

Thanks for reading.
Dave

Mario

Quotethat I can make exactly this happen but for unconfirmed faces?
No.

But feel free to add a feature request in the feature request board.
Other users can discuss this, like it, etc. If this is a problem many users have and they like your request, i will consider adding an option to not write unconfirmed tags.

I can only make my point again: Don't write-back known false or incomplete metadata for exchange purposes. Face tags are only one part of metadata.

davebulow

Thank you so much. I shall take your advice.

At this moment I cannot find a way to 'un-assign' all unconfirmed faces in my database. I need to do this, then do metadata writeback, in order to fix the incorrectly written metadata. I'm failing to find it in the help documents either. Please could you point me to the necessary instructions.

Thanks again for all your help!

Mario


davebulow

Thank you again Mario. I was hoping to remove the person assignment, not delete the face, but it doesn't appear to be possible. I have deleted unconfirmed faces and will re-do face recognition. This should have the same effect I think.

Thank you again for all your help today. I really appreciate it!

Mario

One idea would be to ignore the faces (same menu), which also prevents the tag from being written (the region is written).
When you're ready, you can go through the images in the Viewer, un-ignore them with <I> and if the assigned person is wrong, correct it.

Mario


davebulow

Mario, thank you for continuing to consider this. I've deleted all unconfirmed face annotations and I've started the process of face recognition again. So please don't go to any trouble for my sake. Thanks again for all your help.
Dave

Mario

After pondering this for a while, I decided to no longer make IMatch write unconfirmed tags when writing regions by default. This avoid the problem of false or potentially false XMP region names when the user writes back without checking/correcting/confirming persons assigned to face regions.

A new option has been added (Edit menu > Preferences > Metadata 2) that allows the user to override this and write assigned persons to XMP face regions, confirmed or not.

axel.hennig

Just to be fully clear on that: This change affects the "[XMP-mwg-rs] Region Name" tag and not the "[XMP-iptcExt] Person In Image" tag. The last one was already only written if a face was confirmed. Correct?

davebulow

Dear Mario.
Wow, I wasn't expecting this! I can't thank you enough for considering and adding this fantastic option, since I know you are busy with so many other parts of developing the software. It's very much appreciated. It's rare that a developer is so open to considering small things like this. Even without this I would have continued to recommend IMatch, but now I will do so even more!  ;D
I look forward to trying out the updated version of IMatch when it's available.
Thanks and best wishes
Dave

Mario

QuoteIt's rare that a developer is so open to considering small things like this.
IMatch is shaped and developed in close cooperation with its user base. Having the ability to directly discuss things with users, getting feedback, suggestions, feature requests in this community is a great thing.

No 3-level project manager, stakeholder and product owner roles between the developer and the user base.

I make mistakes or sometimes sub-optiomal (aka stupid) decisions (a lot of IMatch is developed during nights). Or I overlook something or don't consider every angle or potential use-case.

And when I learn about something, I think about it and then make changes if and as needed.
No other user so far reported this as an issue, but I see the potential risk of persisting non-verified face tags in XMP metadata. One can argue either side, but adding this option was not complicated (aka expensive), and so I added it.

The option to force unconfirmed faces exists solely for the purpose of users relying on this behavior, for some reason.
I have added a telemetry hook, and when nobody enables the old behavior over the next six months, I will remove the option and then "don't write tags in XMP regions for unconfirmed persons" will be the default behavior.


davebulow

Amazing! I love this.  ;D  This is precisely the sort of software development that I'm delighted to be able to support and highly recommend to others. I just left a review on Capterra, which I've been meaning to do for a few weeks since purchasing IMatch. I'll continue to recommend it to other photographers and anyone who cares about media management and archiving, etc.

Thanks again for continuing to develop the most customisable media management tool I've used. This was one of the points I made in my review. It's designed as a serious tool, not a toy. So many other software options are available, but they tend to present media management as a simplistic, flashy, one-size-fits all solution. Often these programs break as soon as you try to use them with more than a few hundred photos, and they tend do have so few settings that it's impossible to fit them into your own workflow in any way. On the other hand, IMatch gives you the options to customise it in countless ways. I'm overwhelemed, but in a <b>good</b> way! It trusts the user to know what they're doing. I'm still learning how to use it fully. There are some interesting features I'm yet to use, but I intend to do so soon.

Thanks again,
Dave

Mario

Thank you!
Leaving a review and telling other people about IMatch is the best marketing I can get. Much appreciated :)

Getting seen these days is really hard, especially when "fighting" against companies with deep pockets for search results positions and the ridiculous prices for ads on Google or Facebook or whatever. So expensive, no way to compete.

I often hear from new users "I'd wish I had found IMatch years ago".

I wish there was an easy way to get the word about about IMatch. I try, writing to bloggers and journalists. Usually I never hear back, or only get the price list for ads on their site in return...

To make the Google bot happy, I write a blog post every other week (Google likes new content).

I'm still trying to get the Google bot swallow the new version of the IMatch Help system. This is a 300+ pages high-quality text body and should improve my search engine ranking for DAM and photography-related search terms.

Unfortunately, I don't have the money to spend $5,000 a month (minimum) for Google advertising or SEO or ads on photography-related web sites. I cannot bid against the big players like Adobe/Canto/Widen/Bynder/... for for DAM-related keywords for Google ads.

Adobe, for example, spent 5 billion US$ on sales and marketing in 2023 (Statistica).

Now that IMatch 2025 is out and I have more time, I will again do the marketing dance and write to all bloggers and journalists I can find about it. If you know a potential addressee, let me know.

At least we have AI now, to translate engineer speak into marketing speak at the touch of a button ;D