[Feature] Initially read and eventually write face metadata #4348
Replies: 15 comments 18 replies
|
This seems like it would be very difficult to implement and confusing. Camera manufactures include face recognition in their raws and every single software program handles face recognition tagging differently. The standard exif tags |
|
Here is the documentation by the Metadata Working Group (in archive.org bc their website is down): The relevant section for this discussion is "5.9. Image Region Metadata" (page 51). edit: I found another newer (2019) spec by the IPTC: |
|
I would also love this feature. I have a hundred thousands of photos with existing XMP tags. I meticulously worked for years on them using Picasa. This is the only thing stopping me from switching to Immich. |
|
I agree that face recognition is part of the metadata and should belong to the photo. Whether it is in a sidecar (like Immich already does with Coordinates) or in the file itself is probably a matter of taste. I would really like to see a solution to have the detected faces (which works absolutely fantastic for me in Immich by the way!) somewhere stored in or beside the files, so every other software I use with my huge library can benefit from it (and Immich could benefit with what was tagged over the last decades already by me). |
I did not say other software can not read xmp sidecars. Immich is writing coordinates to sidecars, but not the face / person information. The latter one is what people in this topic would like to have, if I did not understand something incorrectly. |
|
I would not store the embedding information in the xmp. That is application specific and can be saved in the app database.
The embedding can be generated from the tagged images for a new face when they are imported.
…________________________________
From: Alex ***@***.***>
Sent: Sunday, December 10, 2023 11:34:16 a.m.
To: immich-app/immich ***@***.***>
Cc: ericnotthered ***@***.***>; Comment ***@***.***>
Subject: Re: [immich-app/immich] [Feature] Initially read and eventually write face metadata (Discussion #4348)
Facial data will need to have embedding information so that we can utilize the clustering mechanism to group them together when new faces are detected. AFAIK, sidecar don't have that info
—
Reply to this email directly, view it on GitHub<#4348 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFIWTMQZ5T7W67DOWQW53RLYIYFDPAVCNFSM6AAAAAA5TQHPPKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQMJTGEZDS>.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
Does the photo metadata contain the face bounding boxes? Without this data, it is impossible to know which face is assigned to which person when the photo contains more than 1 face, which makes it incompatible with the current implementation of Immich machine learning. |
|
To summarize: The MWG regions identify the bounding box of the face, and provide Name and Description tags.
In terms of workflow, I would suggest as a MVP:
Image import:
* Read image MWG regions from image or sidecar file XMP data.
* If name does not exist in db, create new.
* If exact region already exists in db (same name and bounding box), skip it.
* Add MWG regions to db for each applicable name.
* Calculate embedding for names with added regions.
* ++: On import/refresh, option to ignore MWG regions with names that match faces already identified in that image (ie, avoid creating duplicates).
* ++: On import/refresh option to ignore all MWG regions
* ++: On refresh, option to delete all Immich db regions for the image and create from file/sidecar MWG regions.
Face region added by Immich:
* Write MWG region to XMP data in file and/or sidecar.
Immich face detection:
* Option to ignore any regions with names that match faces already in the db for that image ie, avoid creating duplicates).
* ++: Option to delete existing face regions in image/sidecar file MWG data and write Immich regions.
Note that the requirements to avoid creating duplicates regions could be extended to allow defining a minimum region intersection between the regions in order for the new region to be ignored.
…________________________________
From: rhatguy ***@***.***>
Sent: Wednesday, December 13, 2023 11:44:35 AM
To: immich-app/immich ***@***.***>
Cc: ericnotthered ***@***.***>; Comment ***@***.***>
Subject: Re: [immich-app/immich] [Feature] Initially read and eventually write face metadata (Discussion #4348)
Yes, here is an example of how it looks both from the jpg file and from the xmp file. Note that I replaced the actual names with person1-4. These entries correspond with 4 different faces in this photo. Note how Mylio is tagging the description as "mylio_face". This doesn't affect other software reading the data from the images though. I'm happy to provide some test files if its helpful.
c:\exiftool-12.41\exiftool.exe IMG_0746.jpg
Region Applied To Dimensions W : 4000
Region Applied To Dimensions H : 3000
Region Applied To Dimensions Unit: pixel
Region Type : Face, Face, Face, Face
Region Name : Peron1, Person2, Person3, Person4
Region Description : mylio_face, mylio_face, mylio_face, mylio_face
Region Area X : 0.629789, 0.888162, 0.397451, 0.179784
Region Area Y : 0.349478, 0.316372, 0.342651, 0.365867
Region Area W : 0.062249, 0.061405, 0.073525, 0.079395
Region Area H : 0.107548, 0.110551, 0.121764, 0.190828
Region Area Unit : normalized, normalized, normalized, normalized
Person In Image : Person4, Person4, Person1, Person2
more IMG_0746.xmp
<mwg-rs:Regions rdf:parseType="Resource">
<mwg-rs:AppliedToDimensions
stDim:w="4000"
stDim:h="3000"
stDim:unit="pixel"/>
mwg-rs:RegionList
rdf:Seq
rdf:li
<rdf:Description
mwg-rs:Type="Face"
mwg-rs:Name="Person1"
mwg-rs:Description="mylio_face">
<mwg-rs:Area
stArea:x="0.629789"
stArea:y="0.349478"
stArea:w="0.062249"
stArea:h="0.107548"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
rdf:li
<rdf:Description
mwg-rs:Type="Face"
mwg-rs:Name="Person2"
mwg-rs:Description="mylio_face">
<mwg-rs:Area
stArea:x="0.888162"
stArea:y="0.316372"
stArea:w="0.061405"
stArea:h="0.110551"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
rdf:li
<rdf:Description
mwg-rs:Type="Face"
mwg-rs:Name="Person3"
mwg-rs:Description="mylio_face">
<mwg-rs:Area
stArea:x="0.397451"
stArea:y="0.342651"
stArea:w="0.073525"
stArea:h="0.121764"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
rdf:li
<rdf:Description
mwg-rs:Type="Face"
mwg-rs:Name="Person4"
mwg-rs:Description="mylio_face">
<mwg-rs:Area
stArea:x="0.179784"
stArea:y="0.365867"
stArea:w="0.079395"
stArea:h="0.190828"
stArea:unit="normalized"/>
</rdf:Description>
</rdf:li>
</rdf:Seq>
</mwg-rs:RegionList>
</mwg-rs:Regions>
Iptc4xmpExt:PersonInImage
rdf:Seq
rdf:liPerson4</rdf:li>
rdf:liPerson2</rdf:li>
rdf:liPerson1</rdf:li>
rdf:liPerson3</rdf:li>
</rdf:Seq>
</Iptc4xmpExt:PersonInImage>
</rdf:Description>
</rdf:RDF>
—
Reply to this email directly, view it on GitHub<#4348 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFIWTMW6DTMMJFQ6XZ4NHNTYJIASHAVCNFSM6AAAAAA5TQHPPKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQNBWGUZDQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
Has there been any progress with this? I would love to move to Immich but having to redo all my face metadata is the only thing stopping me. |
|
Same would love to have all the data in xmp so I can reinstall easy immich because all the time consuming task are already in the files |
|
Just to link these two together, there is some good work on this issue going on in #6455. |
|
If it's useful here's the ticket from when digikam implemented it with some sample photos, etc |
|
Writing this data back to the file is the feature that would make me pay for an immich license. The process of retagging photos everytime you have to change software is always the blocker that makes it hard to change software and in trying to get away from google photos I want my photo files to be portable. At the moment I'm using digikam's face tagging and external libraries so I can use Immich as the "view" UI. But Immich's face detection and matching appears to be a lot better than Digikams and would avoid having to fire up a desktop program to tag. |
|
Reading this data is now supported, so I'll close this request and I've opened #15083 to track writing it. |
|
I also created #15107 for merging immich detected faces and metadata and their linked groups. |
Uh oh!
There was an error while loading. Please reload this page.
The feature
It seems like the original discussion around face metadata was closed so opening up a separate request here.
It would be great for Immich to be able to read existing face metadata from pictures (or XMP files). Examples of other software which read face metadata include PiGallery2 and Digikam. At worst case this data could be used as "hints" to Immich's face recognition system where if there was a significant overlap with and existing face region and an Immich discovered face region Immich might assume the existing metadata to be correct and suggest or even automatically tag that region in Immich's database. At best case Immich could use/display the actual face regions from either photos metadata or from accompanying XMP sidecar files.
Secondarily, it would be nice if Immich could write face metadata that was created/modified using Immich in a fashion which could be re-used by other photo management software. An example of an existing software that allows this is Mylio. Mylio reads existing face regions from JPG photos EXIF for instance when images are added, and creates its own XMP files. Then if faces are modified or created inside Mylio it writes those face regions to the XMP files. This way the original image is not modified. This seems to be a fairly acceptable way to ensure a program like Immich isn't responsible for destroying the image itself.
Finally the awesome exiftool is able to take face regions that are written to xmp and write them back into JPG files using a command similar to the below. This allows users who create face regions in XMP (with Mylio for instance) to easily merge those regions into the JPG images through a batch process if they choose.
exiftool.exe -r -ext jpg -overwrite_original -tagsfromfile %d%f.xmp -all:all -wm cg c:\test
Platform
All reactions