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 3671 times)

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • 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: 1362
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: 1362
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: 10926
  • 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: 1362
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: 10926
  • 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: 10926
  • 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: 1362
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: 9139
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: 1362
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: 10926
  • 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

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: NEW: JPEG Image Face Tagging
« Reply #11 on: May 19, 2024, 11:26:29 pm »

Hi yaobing

I have (finally) gotten back to my computer and had time for a bit of testing. This is looking great.

The standalone right-click 'Face Tag Image' is a more intuitive interface. This works well.
In no particular order, some observations, questions and feedback.
Some of below will not be common use cases, just trying to 'break' it and see how far compatibility goes.
Eg it will be uncommon to want to move or resize an existing region...

If no face data is present, would it be possible to simply click and drag on the image to create a new box?
  Currently, if my mouse hovers over the image it is a 'move' icon. If I click and drag, a box is created wherever I released the left-click (with prompt saying 'a new region is created according to the rectangle you created on the image'). This isn't actually true as it does not reflect the area I tried to create.

Special characters seem to be sorted (thanks)

Regions & [People] fields correctly updated in LR when created or changed in MC

If I rename region in LR (that was initially created in MC), this is reflected in MC however I still end up with some duplicate data
   Start with two regions in MC (Spencer & Chris)
   Rename these in LR (Spencer LR & Chris LR)
   Update library from tags in MC
   MC Face Tagging now has four region entries, but only two of these have rectangles in the image view
      The original rectangles are renamed Spencer LR and Chris LR. There are two entries Spencer & Chris without rectangle data now (Point 0,0).
   Similarly, [People] also has four entries instead of two.
I know you have detailed the complexities of knowing what has been changed and linking the region data to the [People] data.
Can you see any way around this? Otherwise, we should be recommending one way tagging direction so as not to create duplicate entries.
Could there be a tool/button in the face tagger to detect and remove 0,0 region data?

If I resize/move a region in LR, this is reflected in MC provided I run 'update library from tags'
If the resized/moved region is also renamed in LR, then above duplication (in region and [People]) also occurs.

Suggestions:
  • ability to view & edit the 'Name' of the region under the box in Face Tag View (a la lightroom images shared in post further up)
  • when typing into the 'Name' box (either in the Face tagging pane on the right or in the box itself if added) please allow autofill / selection from the [People] field
  • additional info that would be helpful to display in the Face Tag pane on the right: Number of People, any Regions not named and any regions without coordinates (eg the 0,0 example above)
  • A 'recently tagged' list could be really helpful here. Often there may be only a handful of people in an album when tagging. Would save manually typing the same names over and over again

Again, hugely appreciate of the efforts here, and building something new from the ground up :) Keep the image love coming!
Logged

Yaobing

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10926
  • Dogs of the world unite!
Re: NEW: JPEG Image Face Tagging
« Reply #12 on: May 21, 2024, 02:19:08 pm »


If no face data is present, would it be possible to simply click and drag on the image to create a new box?
  Currently, if my mouse hovers over the image it is a 'move' icon. If I click and drag, a box is created wherever I released the left-click (with prompt saying 'a new region is created according to the rectangle you created on the image'). This isn't actually true as it does not reflect the area I tried to create.

I will look into this.  You are right.  Drag and release is a better way of creating a rectangle.

Quote

Regions & [People] fields correctly updated in LR when created or changed in MC

If I rename region in LR (that was initially created in MC), this is reflected in MC however I still end up with some duplicate data
   Start with two regions in MC (Spencer & Chris)
   Rename these in LR (Spencer LR & Chris LR)
   Update library from tags in MC
   MC Face Tagging now has four region entries, but only two of these have rectangles in the image view
      The original rectangles are renamed Spencer LR and Chris LR. There are two entries Spencer & Chris without rectangle data now (Point 0,0).
   Similarly, [People] also has four entries instead of two.
I know you have detailed the complexities of knowing what has been changed and linking the region data to the [People] data.
Can you see any way around this? Otherwise, we should be recommending one way tagging direction so as not to create duplicate entries.
Could there be a tool/button in the face tagger to detect and remove 0,0 region data?

I can add an image option "Do not merge data from MJMD" when loading data for face-tagging.

The reason we merge from MJMD is that it was the only way [People] data was saved before we started supporting Regions.  By checking this checkbox, users declare that they already have merged them and thus there is no need to merge anymore.  This is assuming LR saves to both Regions and PersonInImage.

Quote

Suggestions:
  • ability to view & edit the 'Name' of the region under the box in Face Tag View (a la lightroom images shared in post further up)
  • when typing into the 'Name' box (either in the Face tagging pane on the right or in the box itself if added) please allow autofill / selection from the [People] field
  • additional info that would be helpful to display in the Face Tag pane on the right: Number of People, any Regions not named and any regions without coordinates (eg the 0,0 example above)
  • A 'recently tagged' list could be really helpful here. Often there may be only a handful of people in an album when tagging. Would save manually typing the same names over and over again

I will see how much I can do with this list.

Thanks for testing and suggestions.
Logged
Yaobing Deng, JRiver Media Center

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: NEW: JPEG Image Face Tagging
« Reply #13 on: May 23, 2024, 04:40:05 am »

I will see how much I can do with this list.

Thanks for testing and suggestions.

I am invested so no need to thank me  :)
Logged

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Re: NEW: JPEG Image Face Tagging
« Reply #14 on: July 22, 2024, 12:14:20 am »

I can add an image option "Do not merge data from MJMD" when loading data for face-tagging.

The reason we merge from MJMD is that it was the only way [People] data was saved before we started supporting Regions.  By checking this checkbox, users declare that they already have merged them and thus there is no need to merge anymore.  This is assuming LR saves to both Regions and PersonInImage.

I will see how much I can do with this list.

Thanks for testing and suggestions.

Just touching base - before I launch into some more testing, were there any additional changes I have missed since this conversation?

Thanks Yaobing
Logged
Pages: [1]   Go Up