INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: NEW: JPEG Image Face Tagging  (Read 1173 times)

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
NEW: JPEG Image Face Tagging
« on: February 29, 2024, 01:05:56 pm »

Description

MC32.0.22 presents a new feature:  You can select regions in an image and then  describe who/what each region represents.

Instructions

1. In Standard View, select any image, and do "Library tools" -> "Update Library (from tags)", to load existing face-tagging tag (called mwg-rs, (metadata working group) regions)

2. Right-click the image file, and pick "Edit Image...".

3. In the Image Editor, click "Face tagging" to enter face-tagging toolbox.  Existing regions will be listed, if any.  You can edit details of any region, by selecting a region from the drop-down list, and edit its details.

4. You can Add a new region, by clicking Add button, and supply its details.  Most fields are optional, I believe only "Region Type" and the dimensions are mandatory.  But you sure will want to at least put a name in.  Obviously, if you don't already have any existing regions, "Add" button is the first thing you want to click.

5. To edit the dimension of the region, you can drag, and resize the selection rectangle on the image.  If the rectangle does not exist, you can click, hold down the left mouse button, and drag, to create a new rectangle.  You can also just click in the image, a rectangle of default size will be created, centered at your click point.  Then you can move it and resize it as you wish.

6. You can delete a region by clicking the Delete button.

7.  When you have added/edited all the regions you want to, click Apply button.  This will save the info into the XMP mwg-rs tag, and exit "Face tagging" toolbox.  You can click Cancel to exit Image Editor.  You can click Save too, but there is nothing else to save (because the save button is meant to save your editing of the image, but you did not edit the image, you only tagged it).
Logged
Yaobing Deng, JRiver Media Center

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1350
Re: NEW: JPEG image face-tagging
« Reply #1 on: March 02, 2024, 06:55:52 pm »

Awesome
I will set aside some time tomorrow. Look forward to trying this!
Logged

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1350
Re: NEW: JPEG image face-tagging
« Reply #2 on: March 05, 2024, 11:33:54 pm »

Thank you for incorporating this. Have had a chance to do some testing and lots of comments below.
Testing done in MC32.0.23

I imported files from a few sources
1. Already Lightroom Facetagged (and [People] populated in MC from these tags)
2. Vanilla file, no LR Facetag or [People] tagged

Images with No Existing Facetags or [People] tags
Right click > Edit Image opens Image editor
There are no items in 'List of Regions' (as expected)

If I click add, a box is created in the image to define a region. This can be resized to any coordinates (great!)
The Name entered then populates in the 'List of Regions' above. Subsequent Faces/regions are numbered 1,2,3 etc
Once a face/region is created, if I select it in the list of regions, it displays on the image
Only one face/region box can be shown at a time. Would it be possible to visualise them all at once?
Would it be possible to append text (eg the Name) under each box (ie like a caption)? Or have a toggle to do this?
If this can be done, it may also then be possible to edit/correct the name from the caption under the box, rather than first having to navigate to it by selecting it from the list of regions?

In a vanilla file, if I click & create a box in the image (without first clicking on 'Add' or anything in the Face Tagging panel) this does not do anything at present
If I do this, then click 'Add', this ignores my previous box and creates a new one
If a new box is created by interacting directly with the image first, could this automatically create a new region and prompt the user to name it?

Once I click 'Apply' from the Face Tag section, then Save & Close from the Image editor, I am back to my main view.
I can see the [People] field populated with the new entries (great!)

If I edit the name of a person (that was created using the facetagger) in [People] field, the corresponding face 'name' is not updated when I go back into the Image Editor. **Actually, it does not appear I can change the [People Field] entry from the tag window anymore (Tag Window > [People] > R click the entry in the list > 'Rename' but this does not update the field or the Face Tag region list entry. This may be a separate tagging issue??
If I rename it instead from a Pane, it updates the [People] entry but then there is a conflict between this and the Face list entry (which is not updated). I have emailed you and image: People & Facetag List Discrepancy.jpeg

Images with Existing Facetags created in LR
Right click > Edit Image opens Image editor
LR Faces are listed in a drop down, number 1,2,3 etc
I can rename the 'Name' of a face and save it. This updates [People]
I can add new Faces and save it. This also updates [People].

Importing Files Facetagged in MC into LR
For the vanilla file without existing LR tags, the MC created Faces can be seen in the Faces view in LR. Awesome!

For the files prev facetagged in LR, then changes made to Face tags in MC:
LR captures the renamed face and the new faces added. Awesome!

I then edited some of the Face names in LR, and ran 'Update library from tags'
MC updates [People] with the edited Face names (one glitch, it seems to auto Title Case - ie 'LR Retagged' in LR is changed to 'Lr Retagged' in MC. Could this please be changed?
MC updates the List of Regions correctly in the Face Tagging part of image editor (and does not adjust the case unnecessarilty like above) Great!

Other Comments
Glitch in creating/resizing a region: Click and drag to create/resize a box, resize the image editing window (ie the slider between the image view and the Face Tagging pane on the R) > the box border and area highlighted are now unmarried.

The region list does not appear to be able to handle some special characters. See attached Facetagging, Character Display.jpg

If I am looking to tag many photos, this is many clicks to tag and save and close, select the new image and open the editor and open face tagging again. Would it be possible to save the changes from within the face tagger and progress to the next image in the list?

Separate thought, but this is more about 'metadata' than 'Image Editing' perse. Do you think Image Editor is the best place for this? Can I confirm it is making no other changes to the image, only to the tags? I can understand that the Image Editor might make sense as you have ability to interact with specific coordinates in the photo, but if this could be done from a tagging view this would be more user friendly, and more likely to be used. I rarely 'Edit' my images, so creates a disconnect when I have to click 'Edit Image' and then 'Save changes'

A full integration would allow toggle of Faces/Regions +/- editing from any image display view :)

Thanks for the great work
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: NEW: JPEG image face-tagging
« Reply #3 on: March 06, 2024, 08:53:44 am »

Thanks for the detailed feedback.  Just some quick comments:

[People] field is a bit of troublesome.  As it is an editable field, it is too easy to create discrepancies.  Right now, after any face-tagging operation, the result is not sync'ed to [People] field.  You need to run "Update Library (from tags)" in order for the Face-tagging result to show up in [People].  That is going to be an easy fix.  I just need to save [People] field according to the face-tagging result after "Apply" is clicked.

The troublesome problem is what if you edit [People] directly?  I mentioned that before.  If all you do is to change some names, that can still be handled.  But if you delete a person from the list, or add a new one, that creates a big issue with the Regions.

I don't know what to do yet, but the easiest solution is actually to make [People] read-only.  That may have undesirable consequences, especially for other media types.

Is Image Editor the best place for Face tagging?  No it is not.  I used the method just to be able to quickly get some result  ;D since Image Editor already has the infrastructure that is needed.  I will peel face-tagging out of it eventually.
Logged
Yaobing Deng, JRiver Media Center

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1350
Re: NEW: JPEG image face-tagging
« Reply #4 on: March 07, 2024, 01:06:04 am »

Yeah, I can see this will be tricky
Is there anyway internally to link a [People] entry with the face data itself so it's just one consolidated field (with some attributes not necessarily exposed to the user)? So then any given [People] entry could have associated coordinates, or not.

Desired behaviour/functionality could then be:
If a user edits a [People] entry with existing face coordinates, it renames the face entry also
If a user deletes a [People] entry with existing face coordinates, it deletes the face coordinates also
If a user adds a [People] entry (from the people field directly) this is permitted, but it just won't contain face data (or face data is 'empty' and can be filled later per below)
  Potentially in the latter case, the user could be prompted to tag the coordinates when this is more fully integrated
  Could also be helpful to visually show which [People] list entries have a corresponding 'Face' tagged through font/italics or colour or similar. This would be work to code I'm sure.
Within Face tagger, if there are [People] entries without coordinates, these could still be displayed in the regions list and allow user to create the region
If new faces added within Face tagger, this adds an entry to [People]

Stretch goal: [People]\Face views can use the faces to filter files in panes & views.

For reference, some of the LR face views and functionality can be seen in screens attached
  • LR Face View shows pictures of all of the faces (noting it has separate views for Named and Unnamed, as it will recognise faces automatically but user may not have named them yet.
  • LR Facetagging shows interface for tagging faces. In the example, you can click on the Grey text boxes and name. It will autofill predicted text based on existing Face names... ie if I start tying Sall... it will provide options for Sally Evans, Sally Smith etc that user can confiirm. This is all done from the image view itself.
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: NEW: JPEG image face-tagging
« Reply #5 on: March 12, 2024, 10:20:15 am »

I have made the following two changes with regard to [People] and [Image Regions] (in build 25):

Code: [Select]
8. NEW: JPEG image [People] field is written to XMP "PersonInImage" tag.
9. Changed: Image data in [People] field and the Regions data are always merged, so they will be as consistent with each other as possible.  Users are encouraged to use Face-tagging tool to make changes and editing [People] field directly is discouraged.

To achieve consistency, the data from the two fields are always merged.  [Image Regions], edited only using Face-tagging tool, trumps [People] field, meaning that when you click Apply button in Face-tagging tool, [People] field is automatically updated.  When you enter the Face-tagging tool, a merge is performed to include the data from both so no data is lost. 

Merging will make sure users will not lose their existing [People] data.  Users are encouraged to only use the Face-tagging tool to do editing.  If anyone insists on editing [People] directly, here is the expected behavior:

1. If you add a new name to the list, all is fine.  A new region entry will eventually be added to [Image Regions], with no area/region rectangle.
2. If you delete a name from [People], and if [Image Regions] does not already have that name, then the name is truly deleted.  But if [Image Regions] does already contain that name, it eventually will be merged back, so deleting fails to materialize.
3. If you rename a person in [People] field, again the result is dependent on whether the original name already exists in [Image Regions] field: you either successfully rename the name, or you effectively create a new name.

Bottom line:  Make it a habit, to always edit "people in image" using the face-tagging tool.

A side note: [Image Regions] is a hidden field.  It holds data created by the face-tagging tool, and maps to XMP mwg-rs Regions tag.  So don't try looking for the field in MC list of fields, as it is hidden.
Logged
Yaobing Deng, JRiver Media Center

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: NEW: JPEG image face-tagging
« Reply #6 on: March 12, 2024, 12:42:48 pm »

Just a quick note to say that I found a little bug that prevents merging of [People] with [Image Regions] from working if [Image Regions] is empty.

It is fixed for build 26

Fixed: Merging of image [People] and [Image Regions] did not work if the latter is empty.
Logged
Yaobing Deng, JRiver Media Center

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1350
Re: NEW: JPEG image face-tagging
« Reply #7 on: March 13, 2024, 04:12:28 am »

Thank you Yaobing - this sounds great. Look forward to testing soon. All the best, darichman
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8943
Re: NEW: JPEG image face-tagging
« Reply #8 on: March 13, 2024, 02:24:26 pm »

As I use MC's ability to read Lightroom's keyword tree heirarchy, I tend to tag in lightroom, and then when MC imports the Lightroom exports, they more or less import with complete tags. I'm keeping an eye on this though, with limited testing at the weekends only...

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1350
Re: NEW: JPEG Image Face Tagging
« Reply #9 on: March 18, 2024, 12:19:33 am »

I have repeated the testing:

Tagging of [People] and Facetagging in image editor works as described above.
Lightroom also seems to catch every change I make in MC though which is good.
If I edit in Lightroom, and run autoimport in MC (set to update based on tag changes) MC picks up LR changes as expected

Symbols / accented characters are not handled correctly (as per previous, see attached screens)

I have noticed, if I have Facetagged in MC and then edit a face name in LR, then update library from tags in MC: the renamed Face name is recognised, and adds an entry to [People], however the original name is kept in [People] and Face tag (just now without coordinates). I think this is what you mentioned earlier Yaobing - ie I'm not sure how MC would recognise that the Person has just been renamed, not a whole new person. This is probably addressable by workflow, I was just trying every possible way a person might interact with these tags in both programs!

Regarding Point 3 in your list of expected behaviour: Would it also be possible, if a user renames an entry in [People] that has an image region attached, to update this in [Image Region] also, rather than generating a new [Image Region]? If the fields are merged this would be possible?

Would there be a way (eventually) to indicate that a [People] entry has [Image Region] data assigned?
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10862
  • Dogs of the world unite!
Re: NEW: JPEG Image Face Tagging
« Reply #10 on: March 18, 2024, 09:17:30 am »

Thanks for testing.

I have not looked at the special character issue yet.  I will next.

Regarding merging of [People] and [Image Regions], I forgot to mention that we not only merge data read from corresponding tags in XMP, we also merge the ([People]) data from MJMD.  Prior to the introduction of face-tagging, the only place where [People] is saved is in MJMD.  Therefore merging data from MJMD is important.  If we don't do this, users who saved [People] data will have their work lost.

When you save tags to image files, the [People]/[Image Regions] data are always merged and saved to three places: XMP "PersonInImage", XMP "Regions", and MJMD "People".  Because LR is not aware of MJMD, they would not synchronize with MJMD.  That is the issue you see when you face-tag in LR and then look at the data in MC. 

Assuming LR does synchronize XMP PersonInImage and Regions, I hope, and I think this is true, the best we can do is to add an option "Stop merging [people] data from MJMD if XMP data is found", with a warning "You should run Update Library (from tags) on all your image files before turning this option on". 

There is no way to have an indication that a particular name in [People] has a region attached, because [People] is just a semi-colon separated list of names. When you edit an name, or delete one, or add one, all MC knows is the final result -  a new list.  It is not possible to know whether you deleted an old entry and added a new entry, or you just changed the name of an old entry.
Logged
Yaobing Deng, JRiver Media Center
Pages: [1]   Go Up