Update Persons Tag - PersonInImage Tag Results Varied

Started by PandDLong, February 17, 2025, 12:36:58 AM

Previous topic - Next topic

PandDLong


I just updated the tag name for a Person in the Person Editor (I corrected my bad spelling).   It gave me the warning about updating all files, etc.   I proceeded - I only had 9 files.  (Still in IMatch 2023 - last version)

The regions were all updated correctly but the PersonInImage tag had two different results:

1. Six files had the identical tag with 12 names.  It was from one of the photos and was only applicable to that file.

2. Three files had the correct result with just the one name.  


The files were sorted by date order and the file with 12 names was 6th and all the files earlier than that one received the tag with 12 names.    The 3 files later than that file had the correct result.  I do not know which file had the focus when I changed the Person's tag.

I did a write-back of one of the files with 12 names - which has only one face region - and the incorrect PersonInImage tag persisted.

I tried the following with different "wrong" files (and wrote-back after each):

1. Manually corrected the PersonInImage tag - that seemed to work.
2. Delete the PersonInImage tag.  Did not work - it remained empty after write-back.
3. Opened the file in the Viewer and reset the name.   That seemed to work.
4. Opened the file in the Viewer and added another manual face annotation.  That kinda worked but not properly.


#4. When I added a manual face annotation, it set the order for it as '1' (there were 6 existing annotations) but put it last in the PersonInImage tag. The order could not be changed in the Viewer - it was stuck as '1'.

 This persisted through a write-back.    I then added a second manual face annotation and it was assigned order '2'.  It could be changed but only in relation to the other manual annotation that had been stuck at '1'.   

I had two independent annotation orders - the original 1-6 and then the new 1-2.   I have not had this before so I have no idea if it is related to the Person tag issue that started this or is entirely different.

I did a 'Force Update' rescan.  The person stuck in annotation order '1', can now be adjusted but some of the other annotation orders appear overwritten rather than clear. See the top face below (the annotation with the clear '2' was the one previously stuck at '1').
  
Screenshot 2025-02-16 162641.png


This odd writing persists through a write-back. Doing another Force Update - I can see that the original 6 annotations are being repeated - now there is 3 of each appearing on-screen.  Perhaps that can be expected with a Force Update?  The regions in the metadata and the PersonInImage tag are not repeated.

Sorry, a bit of a ramble and I have to wrap-up.

Let me know what you would like me to test or provide (I will be back online in about a day).


Michael

Mario

I think I have fixed this for the next release. I could reproduce it, at least the parts of your bug report I could understand.

To fix this on your end, just use the bring forward a face and then back again. This triggers the repopulation of the PersonsInImage tag, in the correct order (using the next IMatch release).

PandDLong



I have the "scrambled" face annotations issue again. (Unlike last time, this did not occur after making changes to any Persons).  I am on the latest version.  

I had a file with a few faces identified, the metadata had been written back (no pen icon) and in the viewer I added a few more faces by manually inserting.   When I tried to set the annotation order correctly, I noticed that it seemed to have two lists (two #1's etc).  As per this screenshot.

Screenshot 2025-03-07 003636.png

Changing annotation order worked within each "list" independently but I couldn't get it to one list from 1 to 12.  For lack of a better idea - I did a forced update rescan.  It cleaned it up - sort of - and now I have annotations from 1 to 12 but now I have some faces that are marked with more than one annotation order. As per this screenshot.

Screenshot 2025-03-07 003849.png


I was able to get all of the annotations in the desired order and the PersonInImage tag is correct.  However, this odd overlay of annotation numbers is persisting.  Looking at the MWG Regions tag group - it is listing 18 regions (there should only be 12).

The only unusual aspect of this situation that I can think of is that the face annotations and all XMP data had been previously propagated from a related file.  That relation is no longer in affect.  I have other files with the same propagation but have not had this issue.


Let me know what further information will be useful.

Michael

Mario

Do you have face annotations on multiple layers?

That's the only way I can think of this happens. The numbers come from the order or the annotations, and there cannot be two 1's in that order. At least I have never seen this, it was never reported etc.

Can you persist this? Write-back the affected image. Close IMatch. Copy the image in Windows Explorer. Open IMatch and rescan the folder. If the face numbers are duplicated again, send me the image.

PandDLong


The only annotations I have are faces using the IMatch provided functions.  So if there is a second layer, I have no idea how it came to be.

Yes, it persists.  I did as suggested and the copy of the file after being indexed shows annotations from 1 to 18 (which matches the number of regions) but many continue to be overlaid as per the prior screenshot.

I checked the {File.Added} variable and it was first indexed back in January so it would have been part of the Persons tag update that started this thread.   At the time, it was one of the ones that appeared to update correctly and I had updated other metadata after that, but perhaps the Persons tag update is when the problem occurred and it only became known when I added more face annotations.

I checked another file that was part of that group of files. It was a file with just the one face annotation and when I add another, it is created as annotation order #1 - giving two #1s.

Conclusion, this problem is linked to the Persons tag update I did in February.



If this problem with a "second layer" would have been created by the issue that you fixed on February 17th, then this is closed and I just have to do the cleanup on all the files (the solution to the file that was referenced in my very first post was to delete all the annotations and start again).  

If this might be a different issue, then let me know and I can send the file.  I could also enable debug logging and go into one of the files and add a face annotation.

Let me know the direction to take.

Michael

Mario

You can see if there are multiple layers in the Viewer's Annotation Panel.
Database diagnosis without issues?


QuoteYes, it persists.  I did as suggested and the copy of the file after being indexed shows annotations from 1 to 18 (which matches the number of regions) but many continue to be overlaid as per the prior screenshot.

Attach this image please, or provide a link to it.

PandDLong


It looks like there are two layers - Faces and Persons.

Screenshot 2025-03-08 230129.png

Here's a link to it.

1953-12-31 01 p Anneli and Chris Wedding.jpg

I did go into a couple other files that were part of the Person tag change in February.  Unless I have cleaned it up by deleting and re-adding, they appear to be using the Persons layer.  


As a side note, in looking at the Annotation Panel for the first time, I noticed:

   - it does not update if you leave it open with a file, go into the File Window, select a new file and open it in the viewer.  The image changes but the Annotation panel does not fully update and has information from the previous file.  

   - if I select multiple files and change the focused file in the film strip, the annotation panel updates. 

As I haven't used this panel before, not sure if this is intentional or not but it did confuse me at first so I thought I would mention it.


I hope this is helpful.

Michael

Mario

Please open a bug report when you find a bug. We need to keep things separate.

IMatch only creates the "Persons" layer, unless you have changed the name in the Application settings?

I guess if you hide (un-check) one of the layers, the face order will be correct and no dupes are shown. Dupes per layer is normal, since the order number is derived from the annotation Z-order on that layer.

You can select all annotations on one layer and cut/paste them into the other layer. Then remove the empty layer. This will "correct" the face orders you see.

PandDLong

#8
Good point - I opened a bug report about the Annotation Panel not updating sometimes.

Yes, that looks to be the problem.  No idea when or why I changed the setting for 'Face Layer Name' in Metadata 2 but it is set to 'Face'.

In reading the description - "The name of the annotation layer to use for importing face annotations" - this layer is only created when importing files.  As these files were never processed by another application, I assume this happened when I did a 'Force Update' rescan and IMatch "reimports" the metadata.  (I think I have only done this for a few files related to the bug that first created this thread).

The Database diagnosis identified this file as having faces on two layers.   There were no others.   

By random looking, I did find a couple of files with layer of 'Face' (but not Persons so just one layer), is there way to search for files in my database with a Layer name of 'Face'?   (I did search the Help but couldn't find a reference to this unusual type of search).   
The metadata for these files all have a value of 'Face' for the MWG Regions/Region Type tag so a metadata search was not helpful in this case - is there a tag group I need to enable in the Tag Manager?


Thanks for problem solving!

Michael

PandDLong



For a reader in the future who may have a similar problem.

For my files the 'Face' layer had the accurate information (and sometimes was the only layer).  I found a reliable and quick way to correct these files was to:

1. Delete the Persons layer (if there was one)
2. Rename the 'Face' layer to 'Persons'


Michael

Mario

IMatch creates the Persons layer (default name for the English version of IMatch) when it imports face regions or when it creates face annotations during face recognition.

If there are face annotations on multiple layers, the database diagnosis will log warnings to inform the user.

mastodon

Is there a way to make a dinamic category with the used layer in the file? I have some jpg-s with two layers, but don't know how many. I like to get only one layer, that IMatch uses/creates: Persons.

Mario

Tricky. But this is IMatch, so maybe...

<thinking>

Try using this variable for a data-driven category:

{File.Annotations|replace:Collections|Annotations|Region|==}

If a file has layers "Person" and "Faces" and there  is a face annotation on each layer, the variable returns:

People|Sarah;People|Maria

Use the data-driven option to split values at ; to get individual categories.
Not tested, but should get you started.