[NR] Metadata Writeback removes MWG Regions

Started by monochrome, November 21, 2022, 09:51:14 AM

Previous topic - Next topic

monochrome

1. Add MWG Regions to the photo (goes into XMP sidecar)
2. Rescan in IMatch. Regions show up.
3. Add GPS coordinates to the photo in IMatch
4. Write back metadata
5. MWG regions are gone.

Mario

How do you "add MWG regions"?

During import, IMatch imports XMP face regions into IMatch face annotations (XMP-mwg-rs tags).
During write-back IMatch produces XMP face regions (XMP-mwg-rs) from existing face annotations (unless this has been disabled under Edit > Preferences > Metadata 2).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

QuoteHow do you "add MWG regions"?
Custom program.
QuoteIMatch produces XMP face regions
I guess this might clobber existing face regions, if import is set to "off"?

Mario

#3
IMatch imports existing face regions from your files automatically. See Working with XMP Face Regions

So if there are 5 face regions in XMP-mwg-rs, IMatch produces 5 face regions during import. And also writes 5 face regions during write-back. When IMatch produces face regions, it also writes them during write-back so they are accessible to other applications which support XMP.

When you import a file where you have added face regions with your "custom program", do these face regions show in IMatch? This is not clear from your post. Maybe attach a small sample image which has face regions added by your custom program so we can look at the metadata that was added?

So far no other user reported this kind of problem, and IMatch happily imports face regions written by software like Picasa, Lightroom, cameras, even Apple products.
There was once a problem with face regions written by certain Apple products, because Apple messed up and the face regions had a height and width of zero. IMatch contains a work-around for that and assumes a sensible region dimension to work around that.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

QuoteWhen you import a file where you have added face regions with your "custom program", do these face regions show in IMatch?

No, because I have "Import XMP Face Regions" set to "No". So they don't and I don't expect them to.

I did have "Export face annotations to XMP" set to "Yes" which probably was the problem.

If IMatch doesn't have any face regions for a file (because they were never imported), it'll just make the XMP file like its DB, which is to say, removing any existing regions.

monochrome

I haven't been able to verify the solution, but it seems to me that if import of face regions is off, then export should not be on.

Mario

#6
QuoteIf IMatch doesn't have any face regions for a file (because they were never imported), it'll just make the XMP file like its DB, which is to say, removing any existing regions.
This behavior is by design.
The features to prevent IMatch from importing XMP face regions is under consideration for removal. Don't use it.
Let IMatch import the face regions in your files so nothing can get lost.

But I wonder why IMatch would write face regions if the tag is not marked as modified.
If a file has no face regions, IMatch does not write face regions during write-back. The tag simply does not exist in the database. Did you run face recognition on the file (this is on by default I believe)?

ExifTool will send all data it finds in your file, including the XMP face regions, to IMatch and IMatch will store the data in the database. It just will not convert the data into actual usable IMatch face regions when you forcefully disable this. But then the XMP region tag should not be marked as modified.

I think I shall remove the "Don't import" feature in the next region. According to telemetry, nobody is using it and if it causes problems in your case, we better get rid of it. Having race regions in the metadata but not allowing IMatch to use it makes no sense.

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

Quote from: Mario on November 25, 2022, 09:15:25 AMI think I shall remove the "Don't import" feature...
I for one think this is a useful feature to have, to prevent the existing Face Regions in newly indexed files, from creating IMatch Face Annotations.

I found that in many cases the face regions created by my mobile phone were too large, and I preferred to have face recognition in IMatch create them anew...(so I have Import XMP Face regions set to No and Export Face Annotations to XMP set to Yes).

I know that when I reach the face recognition part of my workflow, I can simply uncheck the Ignore images with existing Face Annotations checkbox, and IMatch will recreate them, but I prefer to have them not be there in the first place (as an indicator that the files have not been processed yet).
--Tony

Mario

I have tried to reproduce this.

1. Under Edit > Preferences > Metadata I set "Import XMP Face Regions" and "Export Face Annotations to XMP" to "No".
2. For a JPEG file with a person I create a face annotation in Lightroom and let Lr write back the XMP data.
3. IMatch re-imports the file but does not create a face annotation. OK.

4. I change title, headline, rating and label in the Metadata Panel and write back.
5. The XMP face regions written by Lr remain untouched in the file. Verified with ExifTool. Nothing is removed. OK.

6. Switch IMatch back to the default values for XMP face region import/export.
7. Run Shift+Ctrl+F5 > Reload Metadata
8. IMatch now reads the XMP face region and creates a corresponding face annotation.
9. Person is automatically detected and assigned to the new face annotation.

From my end this looks as it is working perfectly.
Anything different you do?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

I have to close this as "unable to reproduce".

I tried creating regions in an image, then updating the GPS data in IMatch. No matter the sequence or settings IMatch does what you'd expect: regions are left undisturbed.

Mario

I this happens again, try to keep evidence.
The file you've used, what metadata you changed and how, the IMatch log file etc.

I have not experienced this before, and it was never reported by other users.
But I doubt many force IMatch to not import existing face annotations while using other software to detect faces and store it into the XMP data. This hides existing face annotations from IMatch and none of the features related to faces or persons can work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook