Migrate Face data from ACDsee to Synology Photos

Started by Bones, January 20, 2022, 05:48:54 AM

Previous topic - Next topic

Bones

I use ACDsee to manage images and Synology Photos to share them. Both do Face detection  and appear to not recognise eachothers face information - meaning all the ACDsee face taging needs repeating on Synology Photos...

I read in the forum details of how to get into ACDsee. However, i have not seen and discussion on Synology Photos.
Synologies web site ( https://kb.synology.com/en-id/DSM/tutorial/What_metadata_standards_does_Photo_Station_support ) indicate WLPG could be in play
       "People tags adopt the Microsoft Extensible Metadata Platform (XMP) schema, which stores people's names in the metadata according to the selected rectangular area. They can be viewed from Windows Live Photo Gallery."

Does anyone have any ideas/experience

I have only used Exiftool for a few very simple tasks so not clear on where to find info on how to convert WLPG (If Synology Photos is using that properly...) in to ACDSee
can both sets of face data live in teh same image - ie ACDsee face info and Synology Photos face info - or do they interfie with eavh other

Phil Harvey

There is a config file in the full ExifTool distribution that provides a mechanism for converting amongst the various types of regions.  I don't know which type ACDSee uses, but likely one of those.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

ACDSee uses their own region data format, based upon the MWG regions.  The config file to use is the acdsee.config file.

Quote from: Bones on January 20, 2022, 05:48:54 AM
Synologies web site ( https://kb.synology.com/en-id/DSM/tutorial/What_metadata_standards_does_Photo_Station_support ) indicate WLPG could be in play
       "People tags adopt the Microsoft Extensible Metadata Platform (XMP) schema, which stores people's names in the metadata according to the selected rectangular area. They can be viewed from Windows Live Photo Gallery."

The Windows Live Photo Gallery used Microsoft MP regions, so that's probably the region involved.  You can verify by running this command.  The output should show the names and the region data.
exiftool -XMP-MP:all file.jpg

QuoteI have only used Exiftool for a few very simple tasks so not clear on where to find info on how to convert WLPG (If Synology Photos is using that properly...) in to ACDSee

Download the acdsee.config file from the above link, save it in the same directory as exiftool.  Then you can run the command listed in that file under "To convert Microsoft Regions to ACDSee regions"

Quotecan both sets of face data live in teh same image - ie ACDsee face info and Synology Photos face info - or do they interfie with eavh other

They can both be in the file and are completely separate from each other.

Side note, it looks like I forgot to create an option to convert ACDSee regions into other region types.  Looks like I have some work to do.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

@StarGeek: Thanks, I had forgotten about the ACDSee regions.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Bones

@StarGeek: Thanks - appoligies for the non response - i  read it and then did a chunk of reading on the forum - was feeling it maybe beyond me  - However i will progress it as far as i can  - but may mean a few newbie questions

Quote from: StarGeek on January 20, 2022, 10:49:00 AMThe Windows Live Photo Gallery used Microsoft MP regions, so that's probably the region involved.  You can verify by running this command.  The output should show the names and the region data.
exiftool -XMP-MP:all file.jpg

I ran that on an image from Sonology Photos - got zero response

C:\Temp\FaceDataTests>exiftool -XMP-MP:all A7A08263_Photos.JPG

C:\Temp\FaceDataTests>

I then ran a simpler command (See below) to confirm i have ExifTool working - seems to function OK
This would indicate to me that the image does not have any "MP" regions in it - i was not sure how to identy what it does have in it
Any suggestions


C:\Temp\FaceDataTests>exiftool A7A08263_Photos.JPG
ExifTool Version Number         : 12.49
File Name                       : A7A08263_Photos.JPG
Directory                       : .
File Size                       : 8.6 MB
File Modification Date/Time     : 2022:07:29 17:39:59+08:00
File Access Date/Time           : 2022:11:03 22:05:18+08:00
File Creation Date/Time         : 2022:08:29 18:32:23+08:00
File Permissions                : -rw-rw-rw-
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : Abbey, Kate, Zac in Mar 2022 @ Peel Street Jolimont Western Australia AU
Make                            : SONY
Camera Model Name               : ILCE-7M3
Orientation                     : Horizontal (normal)
X Resolution                    : 350
Y Resolution                    : 350
Resolution Unit                 : inches
Software                        : ILCE-7M3 v4.01
Modify Date                     : 2022:03:12 17:20:26
Artist                          : Tony Watkins
Y Cb Cr Positioning             : Centered
Copyright                       : Tony Watkins
Exposure Time                   : 1/40
F Number                        : 4.0
Exposure Program                : Aperture-priority AE
ISO                             : 250
Sensitivity Type                : Recommended Exposure Index
Recommended Exposure Index      : 250
Exif Version                    : 0231
Date/Time Original              : 2022:03:12 17:20:26
Create Date                     : 2022:03:12 17:20:26
Components Configuration        : Y, Cb, Cr, -
Brightness Value                : 3.0171875
Max Aperture Value              : 4.0
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 35.0 mm
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 6000
Exif Image Height               : 4000
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
File Source                     : Digital Camera
Scene Type                      : Directly photographed
Custom Rendered                 : Normal
Exposure Mode                   : Auto
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 35 mm
Scene Capture Type              : Standard
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Lens Info                       : 24-240mm f/3.5-6.3
Lens Model                      : FE 24-240mm F3.5-6.3 OSS
GPS Version ID                  : 2.3.0.0
GPS Status                      : Measurement Void
GPS Map Datum                   : WGS-84
GPS Differential                : No Correction
XMP Toolkit                     : XMP Core 5.5.0
Rating                          : 2
Label                           :
Date Created                    : 2022:03:12 17:20:26+08:00
Instructions                    : Abbey's 21st
Caption Writer                  :
Headline                        :
Authors Position                :
State                           : Western Australia
Country                         : Australia
Transmission Reference          : 21a5-220725
Category                        :
Supplemental Categories         : , ,
Web Statement                   :
Usage Terms                     : Camera Owner:Tony Watkins
Edit Status                     :
Location                        : Peel Street
Country Code                    : AU
Intellectual Genre              :
Creator Address                 :
Creator City                    :
Creator Region                  :
Creator Postal Code             :
Creator Country                 :
Creator Work Email              :
Creator Work Telephone          :
Creator Work URL                : C:\NAS49\Media\AllOurMedia\1 Our Pictures\Cataloged (2 )\2022
Scene                           :
Subject Code                    :
Additional Model Information    :
Location Created Sublocation    :
Location Created City           :
Location Created Province State :
Location Created Country Name   :
Location Created Country Code   :
Location Created World Region   :
Person In Image                 :
Organisation In Image Name      :
Organisation In Image Code      :
Model Age                       :
Event                           :
Copyright Owner ID              :
Copyright Owner Name            :
Image Creator ID                :
Image Creator Name              :
Subject                         :
Creator                         :
Rights                          :
Title                           :
Description                     : Abbey, Kate, Zac in Mar 2022 @ Peel Street Jolimont Western Australia AU
Caption                         : Abbey, Kate, Zac in Mar 2022 @ Peel Street Jolimont Western Australia AU
Date Time                       : 2022:03:12 17:20:26.000
Author                          : Tony Watkins
Notes                           : Abbey's 21st
Tagged                          : False
Categories                      : <Categories><Category Assigned="0">People<Category Assigned="0">Family<Category Assigned="0">Family-Neta<Category Assigned="0">Family-Watkins John<Category Assigned="0">Family Bruce<Category Assigned="1">Abbey</Category><Category Assigned="0">Family Zac<Category Assigned="1">Zac</Category><Category Assigned="1">Kate</Category></Category></Category></Category></Category></Category></Category></Categories>
Collections                     : <Collections><Collection Assigned="0">Export Collections<Collection Assigned="1">Other Pics (12 Stars)</Collection><Collection Assigned="0">Events<Collection Assigned="1">2022 03 Abbey 21st</Collection></Collection></Collection></Collections>
Keywords                        : Imports|Import_20210630
Regions Applied To Dimensions H : 4000
Regions Applied To Dimensions Unit: pixel
Regions Applied To Dimensions W : 6000
Regions Region List DLY Area H  : 0.058453
Regions Region List DLY Area W  : 0.032158
Regions Region List DLY Area X  : 0.528250
Regions Region List DLY Area Y  : 0.344226
Regions Region List ALG Area H  : 0.056750
Regions Region List ALG Area W  : 0.037833
Regions Region List ALG Area X  : 0.528250
Regions Region List ALG Area Y  : 0.343375
Regions Region List Name        : Jody
Regions Region List Type        : Face
Regions Region List Name Assign Type: auto
Regions Region List Distance    : 0.328220
Current IPTC Digest             : cf4a1383f4b6063bb2940632c690894b
Coded Character Set             : UTF8
Fixture Identifier              : SynPhot-220725
Country-Primary Location Name   : Australia
Country-Primary Location Code   : AU
Province-State                  : Western Australia
Sub-location                    : Peel Street
City                            : Jolimont
Special Instructions            : Abbey's 21st
Source                          : via FTP
Original Transmission Reference : 21a5-220725
Caption-Abstract                : Abbey, Kate, Zac in Mar 2022 @ Peel Street Jolimont Western Australia AU
Credit                          : Abbey, Kate, Zac
IPTC Digest                     : cf4a1383f4b6063bb2940632c690894b
Image Width                     : 6000
Image Height                    : 4000
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 4.0
Image Size                      : 6000x4000
Megapixels                      : 24.0
Scale Factor To 35 mm Equivalent: 1.0
Shutter Speed                   : 1/40
GPS Latitude                    : 31 deg 56' 42.51" S
GPS Longitude                   : 115 deg 48' 38.06" E
GPS Latitude Ref                : South
GPS Longitude Ref               : East
Circle Of Confusion             : 0.030 mm
Field Of View                   : 54.4 deg
Focal Length                    : 35.0 mm (35 mm equivalent: 35.0 mm)
GPS Position                    : 31 deg 56' 42.51" S, 115 deg 48' 38.06" E
Hyperfocal Distance             : 10.19 m
Light Value                     : 8.0
Lens ID                         : FE 24-240mm F3.5-6.3 OSS

C:\Temp\FaceDataTests>


Phil Harvey

Would it be possible for you to attach the output of this command (out.xmp)?:

exiftool -xmp -b A7A08263_Photos.JPG > out.xmp

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Quote from: Bones on November 03, 2022, 10:17:45 AMI ran that on an image from Sonology Photos - got zero response

C:\Temp\FaceDataTests>exiftool -XMP-MP:all A7A08263_Photos.JPG

C:\Temp\FaceDataTests>

It's been a while but what I think I was trying to say was to run that command on a file that properly showed the regions in Synology Photos to verify that Synology was using Microsoft regions.

The output you list shows that the ACDSee regions exist in that image, but that was a given.

So step by step.
  • Save the above link to the ACDSee config into a file named acdsee.config in the same directory as exiftool.
  • Set up a test file outside of Synology Photos and run this command on that file
    exiftool -config acdsee.config "-RegionInfoACDSee<MPRegion2ACDSeeRegion" file.jpg
  • Import that test file into Synology Photos and see if the regions are recognized.

If you want to be alerted to when there is an update in this thread, you can hit the button in the upper right corner of this thread and change "No Alerts or Emails" into "Receive Emails and Alerts"
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Bones

Quote from: Phil Harvey on November 04, 2022, 08:54:34 AMWould it be possible for you to attach the output of this command (out.xmp)?:

exiftool -xmp -b A7A08263_Photos.JPG > out.xmp

- Phil
Certainly
out.xmp

Bones

Thanks StarGeek - yes a long while - appreciated
Thanks for the clear steps and tip on being alerted - handy

Quote from: StarGeek on November 04, 2022, 12:16:33 PMThe output you list shows that the ACDSee regions exist in that image, but that was a given.
Yep - the images in SynPhotos originally came from Acdsee - so i suspect the face regions got added by acdess on the way to SynPhoto...


Steps i took
  • downloaded latest acdsee.config file and saved to c:\windows with exiftool.exe (12.49)
  • added a new Photo to acdsee - face recognised a face and gave it a name in acdsee
  • ran - exiftool -config acdsee.config "-RegionInfoACDSee<MPRegion2ACDSeeRegion" A7A09102_1_face_in_acdsee.jpg
  • got this response -
    Warning: No writable tags set from A7A09102_1_face_in_acdsee.jpg
        0 image files updated
        1 image files unchanged
  • ran the exiftool -xmp -b A7A09102_1_face_in_acdsee.jpg > out9102_1_face_in_acdsee.xmp  - just incase it helps

I presume the no files updated meant no no need to import the file to synPhoto

[/list]

StarGeek

Ooops, Sorry.  Strike that, reverse that.

You want to copy the ACDSee regions to the Microsoft regions.

Aaaand it looks like I never made a way to reverse that.  The problem at the time was someone trying to import regions into ACDSee, not from it.

It shouldn't be too hard to fix that, as the ACDSee regions are almost exactly like the MWG regions. But they are doubled up as ACDSee holds two regions, ALY region and DLY region.  The ALY regions are those assigned by ACDSee and are usually squares.  The DLY regions may also be assigned by ACDSee but are usually not square.  Also, any manually applied regions will be DLY regions.

Dang, that makes things messy because there could be DLY regions but not ALY regions.  So the options would be to keep it simple, convert the ALY region if it exists, if not, fall back to the DLY region.  Or give options to directly convert ALY or DLY regions, giving two options for each of the conversions (into MWG region, Microsoft region, and IPTC region), for a total of 6 options.  Or do both and have 9 options.

Give me a couple days and I'll see if I can add options to the ACDSee.config file to convert from ACDSee regions.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Bones

Thanks Stargeek - i got as far as wondering when i read the command but knew to little to even enquire :) :)

No rush on my part - appreciate greatly the effort...

Bones

Stargeek -
thought i would see how you were progressing
has this one turned into a bridge to far - tis possible for me to try other avenues if so

StarGeek

I'm terribly sorry, totally slipped my mind.  I'll get right on it tomorrow.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

vlapr

I think the big problem is that Synology Photos doesn't store face info into image. They store it into synofoto postgres database in the table face.

Synofoto:

{"bottom_right":{"x":0.34011523589770659,"y":0.62085489588459641},"top_left":{"x":0.21477150603127165,"y":0.39744453730545642}}+| {"left_eye":{"x":0.2455744647
5171085,"y":0.48250793096587413},"mouth_left":{"x":0.25729118447624305,"y":0.56311083215428148},"mouth_right":{"x":0.30893572452410345,"y":0.55248398668184051},"nose":{"x":0.27
93270119014748,"y":0.52108356145423229},"right_eye":{"x":0.30294899203590608,"y":0.47188964603454109}}
{"bottom_right":{"x":0.51074700940423601,"y":0.5123224934255044},"top_left":{"x":0.39867161613987784,"y":0.30363791758619896}} +| {"left_eye":{"x":0.4325065374
8700624,"y":0.38558944942444329},"mouth_left":{"x":0.43344625894674721,"y":0.45704945241372419},"mouth_right":{"x":0.47800949424484579,"y":0.46189898393285556},"nose":{"x":0.45
890561723081252,"y":0.43000345905934734},"right_eye":{"x":0.48471985074768276,"y":0.38990047785240833}}

Lightroom info for the same photo:
         <mwg-rs:Regions rdf:parseType="Resource">
            <mwg-rs:AppliedToDimensions stDim:w="1443" stDim:h="1016" stDim:unit="pixel" />
            <mwg-rs:RegionList>
               <rdf:Bag>
                  <rdf:li>
                     <rdf:Description mwg-rs:Rotation="0.00000" mwg-rs:Name="Person1" mwg-rs:Type="Face">
                        <mwg-rs:Area stArea:h="0.35531" stArea:w="0.20859" stArea:x="0.27270" stArea:y="0.48671" />
                     </rdf:Description>
                  </rdf:li>
                  <rdf:li>
                     <rdf:Description mwg-rs:Rotation="0.00000" mwg-rs:Name="Person2" mwg-rs:Type="Face">
                        <mwg-rs:Area stArea:h="0.30610" stArea:w="0.18018" stArea:x="0.45738" stArea:y="0.39616" />
                     </rdf:Description>
                  </rdf:li>
                  <rdf:li>
                     <rdf:Description mwg-rs:Rotation="0.00000" mwg-rs:Name="Person3" mwg-rs:Type="Face">
                        <mwg-rs:Area stArea:h="0.19783" stArea:w="0.11642" stArea:x="0.69993" stArea:y="0.38041" />
                     </rdf:Description>
                  </rdf:li>
               </rdf:Bag>
            </mwg-rs:RegionList>
         </mwg-rs:Regions>


Is there any way how to convert Lightroom/ACDSee info into Synology Photos data and put them directly inside the database? I saw Synology has more info (like eyes, nose, mouth positions) but at least the face region and person name??

Bones

@vlapr - you are correct.
I did do some other digging/trials and played with it for a while - where i got to was - I think it loads SOME Metadata from the files - and i suspect it reloads/updates that on "re-index" - how ever nothing at all for Face data.
Best i can spot is it 100% ignores any/all face tag data and does its own AI thing saving ALL the results in it database.
It never writes to FACE tags in the files.
I can see face data in the DB - Postgres - and edit it with no major side effects yet. However, using the Face tags as the source - let alone the master - of face regions and names is not seeming to be practical - certainly outside my skill/ability.
Its a full blown postgres application with 100's of triggers and procedures on most of the 150 tables/views  :)

i will look at some other way to get from a DAM to a good Web based Photoviewer without two many manual steps or complex programing