Some time ago, Windows Photo Gallery introduced a nifty face recognition feature dubbed People Tags. The face information would be saved back to the file as XMP metadata using Microsoft People Tags Schema. While Windows Explorer and some third party applications such as Google’s Picasa, Digikam, Photo Supreme, Photo Station, GeoSetter can read People Tags many others may not. Also, given Windows Photo Gallery end of support, you may be also considering using the more established Metadata Working Group Face Regions schema for storing such information back to their photo files. Adobe Lightroom, for example, uses MWG Face Regions for the same purpose of labeling faces in photos.
You may also be considering exporting and/or converting People Tag names to keywords or add them to the IPTC “People Shown in Image” fields. In all you may have devoted a lot of time in manually including People Tags in your photo collection, so here are some ways to ensure that effort has effort was not in vain.
All of these options can be accomplished using the very nifty exiftool utility. In my previous post I described how to install this utility, so I will not delve into that how to on this one.
First things first, as with any file operation which involves modifications, ensure you have backed-up your photos before proceeding.
Exporting People Tag Data to a File
The following command will export the people tag persons displayed names to a tab-delimited file named PeopleTags.txt which can be opened in Microsoft Excel or a database such as Microsoft Access. This is particularly helpful when you wish to create an index or analyse you photos’ metadata fields in ways your photo manager may not be capable of.
exiftool -T -Directory -Filename -RegionPersonDisplayName -r *.jpg > PeopleTags.txt
The -r flag stands for recursive and will ensure that files within subdirectories are included in PeopleTags.txt.
Converting People Tags to MWG Regions
In addition to the exiftool executable, you will need to ensure you have the proper exiftool config file for converting mp tags to mwg. The config files extend exiftool functionalities to do other things. In this case, the config file needed is the convert_regions.config which can be obtained in the full Image-ExifTool (.tar.gz) distribution or downloaded from here. A forum discussion thread on the subject can be found here.
The command to use to convert Microsoft People (MP) Tags to Metadata Working Group (MWG) Regions is:
exiftool -config convert_regions.config "-regioninfo<myregion" *.jpg
Copy People Tags to photo keywords
For Face Regions to be displayed in Adobe Lightroom, the MWG Face region name needs to be accompanied by a keyword. As far as I know, this is not mentioned in the MWG spec, but it is a quirk in Lightroom. To accomplish this you can use the following command. Also, as keywords/tags are read by many photo management applications this is a good way to make person’s names available, or when uploading files to a site such as Flickr which reads this information.
exiftool *.jpg -"xmp-dc:Subject+<RegionPersonDisplayName"
Copy People Tags to “Person Shown in Image”
The IPTC Extension Schema has another way to record persons depicted in the image which can also be a useful way to preserve the names of the people in the image as well. The exiftool tag is PersonInImage.
exiftool *.jpg -"PersonInImage<RegionPersonDisplayName"