Picasa face tagging into ResourceSpace with Exiftool

997 views
Skip to first unread message

Julie Swierczek

unread,
Dec 18, 2014, 2:21:48 PM12/18/14
to resour...@googlegroups.com
This is a long one, but I'm providing a lot of detail so others can try this out.  tl;dr: I explain how I tag faces in Picasa and then extract that information in ResourceSpace. I discuss technical issues (and workarounds), tools, and metadata.

My first caveat is that this has only been tested with jpegs so far.  (See the end for more details on Picasa face tagging, XMP, and other issues.)

Secondly, this requires that you have Exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/) installed with ResourceSpace.

Our museum just had its re-opening after a major renovation, and this resulted in an avalanche of events photography.  I want to identify as many people in the images as possible, and I'm taking advantage of Picasa to do face tagging.  I also use the caption field in Picasa to record captions for each photo.

I am using Picasa 3.9.138 in Windows 7.  Once I tag a group of photos, I use Tools>Experimental>Write Faces to XMP.  In the dialog box, I choose "Write Faces" or "Write All".  If you do not do this step, the names are only stored in the picasa.ini file that resides in each folder with the images.  You *must* use the "Write Faces to XMP" method to embed the names in the photo metadata.

(After doing that, this is a good opportunity to backup your Picasa data.  In the Picasa Library view, use Tools>Backup Pictures.  Name your backup set something useful in Box 1, then choose "Select All" in box 2, then select "Backup".  The first backup takes a while, but subsequent backups using that same backup set are faster.  Be forewarned that there are grumblings on message boards about corrupted backups, so don't put all your proverbial eggs in this basket; also make sure your hard drive where Picasa stores data locally is being backed up.)

The face names are stored in the Microsoft XMP Namespace Photo Region Schema, which is an XMP extension.  (See more details from Microsoft: http://msdn.microsoft.com/en-us/library/ee719905%28VS.85%29.aspx.  And if you want more details on how Picasa face tagging works, this freeware software has a useful explanation: http://www.anvo-it.de/wiki/avpicfacexmptagger%3amain.)

The trick with Picasa's face tagging with this XMP extensions is that if you open the file in Adobe Bridge or Photoshop, and look at the file info, you won't see the metadata field where the names are stored.  (The names are actually stored in two fields, but I found that exporting the names from one of the fields was problematic. If you use Exiftool to view the face names metadata, you'll see that it's in both exif tags RegionName>PersonDisplayName and RegionName>PersonInImage.  If you use those tags to export the data to a CSV, for example, the RegionName>PersonDisplayName doesn't work well.  It exports the names in each photo with tabs between them, thus making a mess of your CSV.  RegionName>PersonInImage works the way you expect, with "Region Name" as the column title and the names from each photo as a comma separated list inside a single cell in the column.)

For that reason, I decided to focus on the RegionName>PersonInImage and ignore the other field, but I'm just mentioning that the other field exists in case any of the other metadata enthusiasts out there need to know.

I then wanted to get that face tagging information from Picasa into ResourceSpace.  I first used Exiftool to export the data into a spreadsheet, so that I could copy that into a CSV uploader spreadsheet.  But then I recalled that ResourceSpace handles exif data well, so I didn't need to do that.  I instead created a new "Picasa Named Persons" field.  (I'm keeping this separate from my normal "Names Persons" field until I do more testing.)  I created the field as a global field, with the critical part being the Exiftool field: regionname.

Now, when I upload these face-tagged photos into ResourceSpace, it extracts the names from the xmp data.  I have my Picasa Names Persons field set to display, so I get a list of the names in the metadata that appears below my image.

If any of your fields are set to read the Exiftool: Description, then the captions created in Picasa will also be available in ResourceSpace.

----------
Now for the other, non-ResourceSpace details.

Some advice for making all this face tagging sustainable in Picasa:  There's no way I can keep every photo I describe in Picasa.  For that reason, I keep a folder locally (and backed up, because this is worth a lot of money in terms of my time) called "People".  Every time I tag a person for the first time in Picasa, I also do a snippet of that person's face and add that image to the People folder.  That way, if I later remove the images that I've tagged from Picasa, I will still have one master photo of each person that is tagged in Picasa.  I names these files with the person's name, so if I ever have an opportunity to move into some other face-tagging program in the future, I've got a set of named photos that is easily portable.  I realize that Picasa's facial recognition probably improves when there are multiple tagged versions of a face available, but I just can't imaging keeping every tagged image in Picasa indefinitely, since I'll run out of space on my hard drive.

Next issue: This whole trick of embedding the XMP face data is known to work (most of the time) in JPG.  There are message boards where people talk about it not working in other formats like dng.  I've thought of a workaround for now: I can create a set of derivative jpgs from the master files, and work with the jpgs in Picasa.  Then, instead of using the process outlined above for having ResourceSpace read the metadata from the file, I'll have to do the extra step of extracting the tagged names into a CSV file.  I use Exiftool, with the command: exiftool -csv [directory] > output.csv

Actually, I can't be bothered to type directory names, so I first navigate to the directory where the images are stored, use Shift+right-click and choose "open command window here" (or type "cmd" (without quotes) in the address bar in Windows Explorer once I've navigated to the correct folder) and then copy and paste this into the command prompt:
exiftool  -RegionName>PersonInImage -csv %CD% > output.csv

Also, I write captions for images while I'm in Picasa, so I can also export those if necessary, by adding the Description field for export (Description is where the Picasa Captions are stored):
exiftool -Description -RegionName>PersonInImage -csv %CD% > output.csv

So, I can still work in Picasa, but then export the face names and the description fields so that I can add them to the CSV that I'll create for the CSV uploader.  I'll use that on the original files in dng or other formats.  It's clunky, but it works. The failure of Picasa to embed the face names in XMP is not something I expect to be fixed, as it has to do with which formats support the Microsoft XMP extension where this information is kept - and not all file formats do. Especially not older specifications of them.

I tested adding a name to my Picasa Face Name field in ResourceSpace after importing a photo, and that worked.  The name showed up as expected. When I downloaded the metadata for that file, the added name appeared in the appropriate field.

Another caveat is that while Picasa writes the metadata to the XMP fields, it doesn't read it from there.  Picasa relies on the picasa.ini file in each image folder for its face-tagging operations.  When I added another name to the Picasa Face Name field in ResourceSpace, the name was added to the metadata field and I can confirm the name showed up in the RegionName field when I viewed it with Exiftool.  I then added that image back into Picasa, and Picasa did not show *any* tagged faces in the photo.  So Picasa is not reading that metadata from the file.  (In a way, this makes sense, as the Microsoft XMP extension records names and also regions of the photo that correspond to those names.  I didn't indicate what region the added name refers to, so I can see this being an opportunity to end up with messy metadata.  I don't know enough about the spec to know if it's permissible to have names but not regions, but in any case, I can see why Picasa just ignores it.)

My last tip for super fast tagging is to use a text expander like AutoHotKey (http://www.autohotkey.com/) when you are writing captions in Picasa (or anywhere else, for that matter).  I regularly have to write "Professor Firstname Lastname, So-and-so professor of this field of study and Dean of this school" as part of my descriptions of event photos, and if I know that person will show up in a bunch of photos, it's worth it to at least temporarily add that to my text expander for efficiency and accuracy.  (I don't do this level of description for all images, but it's worth it for these images.)

I hope that is useful to others and I look forward to hearing from anyone else who figures out ways to improve on these ideas.

Julie

David Ehnebuske

unread,
Dec 18, 2014, 3:19:01 PM12/18/14
to resour...@googlegroups.com
Julie,

Thanks for this write-up. I know it was a bunch of work to put together. Very useful information.

Dave Ehnebuske
--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.org
---
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew Patulski

unread,
Dec 19, 2014, 4:08:22 PM12/19/14
to resour...@googlegroups.com
Julie,
Great Stuff--thank you! I am thinking this might be very applicable for NPO and EDU environments already using Google Apps that need to build a workflow into a DAM--Like Resourcespace.
BR,
MRP
Reply all
Reply to author
Forward
0 new messages