osxphotos export to include face rectangles #632
Replies: 3 comments 11 replies
-
osxphotos should currently do this in the XMP sidecar in both mwg and mpri. But the sidecars have been very difficult to test as I don't have access to software that actually reads them correctly. Here's sample output from one of the osxphotos test libraries: <rdf:Description rdf:about=""
xmlns:mwg-rs="http://www.metadataworkinggroup.com/schemas/regions/"
xmlns:stArea="http://ns.adobe.com/xmp/sType/Area#"
xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#">
<mwg-rs:Regions rdf:parseType="Resource">
<mwg-rs:AppliedToDimensions rdf:parseType="Resource">
<stDim:unit>pixel</stDim:unit>
</mwg-rs:AppliedToDimensions>
<mwg-rs:RegionList>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<mwg-rs:Area rdf:parseType="Resource">
<stArea:h>0.055691</stArea:h>
<stArea:w>0.083557</stArea:w>
<stArea:x>0.627687</stArea:x>
<stArea:y>0.507298</stArea:y>
<stArea:unit>normalized</stArea:unit>
</mwg-rs:Area>
<mwg-rs:Name>Katie</mwg-rs:Name>
<mwg-rs:Rotation>0.0</mwg-rs:Rotation>
<mwg-rs:Type>Face</mwg-rs:Type>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<mwg-rs:Area rdf:parseType="Resource">
<stArea:h>0.066277</stArea:h>
<stArea:w>0.099440</stArea:w>
<stArea:x>0.525702</stArea:x>
<stArea:y>0.278760</stArea:y>
<stArea:unit>normalized</stArea:unit>
</mwg-rs:Area>
<mwg-rs:Name></mwg-rs:Name>
<mwg-rs:Rotation>0.0</mwg-rs:Rotation>
<mwg-rs:Type>Face</mwg-rs:Type>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<mwg-rs:Area rdf:parseType="Resource">
<stArea:h>0.064400</stArea:h>
<stArea:w>0.096624</stArea:w>
<stArea:x>0.349200</stArea:x>
<stArea:y>0.384542</stArea:y>
<stArea:unit>normalized</stArea:unit>
</mwg-rs:Area>
<mwg-rs:Name>Suzy</mwg-rs:Name>
<mwg-rs:Rotation>0.0</mwg-rs:Rotation>
<mwg-rs:Type>Face</mwg-rs:Type>
</rdf:li>
</rdf:Bag>
</mwg-rs:RegionList>
</mwg-rs:Regions>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:MP="http://ns.microsoft.com/photo/1.2/"
xmlns:MPRI="http://ns.microsoft.com/photo/1.2/t/RegionInfo#"
xmlns:MPReg="http://ns.microsoft.com/photo/1.2/t/Region#">
<MP:RegionInfo rdf:parseType="Resource">
<MPRI:Regions>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<MPReg:PersonDisplayName>Katie</MPReg:PersonDisplayName>
<MPReg:Rectangle>0.585908, 0.479452, 0.083557, 0.055691</MPReg:Rectangle>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<MPReg:PersonDisplayName></MPReg:PersonDisplayName>
<MPReg:Rectangle>0.475982, 0.245622, 0.099440, 0.066277</MPReg:Rectangle>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<MPReg:PersonDisplayName>Suzy</MPReg:PersonDisplayName>
<MPReg:Rectangle>0.300888, 0.352342, 0.096624, 0.064400</MPReg:Rectangle>
</rdf:li>
</rdf:Bag>
</MPRI:Regions>
</MP:RegionInfo>
</rdf:Description> If you can provide an XMP with face regions properly coded that DigiKam will read I can take a look at what I'm doing wrong. |
Beta Was this translation helpful? Give feedback.
-
Could you provide the exiftool output in json format using |
Beta Was this translation helpful? Give feedback.
-
I've enabled this by default in 0.45.12 so you won't need the --beta flag once upgraded. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great tool. Is it possible to use osxphotos export to put into XMP the face rectangles (either Metdata Working Group (mwg) face regions or Microsoft Photo Region Rectangle (mpri) or both). It looks like it should be possible as the FaceInfo object seems to have this information but I couldn't find an option in the "osxphotos export" command.
At the moment I am having to import everything into digikam and redo face tagging. An exiftool output of the relevant bits looks like this (for two people) after digikam:
Region Applied To Dimensions W : 4128
Region Applied To Dimensions H : 3096
Region Applied To Dimensions Unit: pixel
Region Name : Ann, Kate
Region Type : Face, Face
Region Area X : 0.336604, 0.625
Region Area Y : 0.444444, 0.453327
Region Area W : 0.119913, 0.116764
Region Area H : 0.186693, 0.18637
Region Area Unit : normalized, normalized
Region Person Display Name : Ann, Kate
Region Rectangle : 0.276647, 0.351098, 0.119913, 0.186693, 0.566618, 0.360142, 0.116764, 0.18637
Any ideas how to get this via osxphotos?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions