iPhoto ‘09: What is Faces doing behind the scenes

January 29, 2009 at 4:14 pm Mac, Tips Add comments

Apple released iLife ‘09 this week which includes the updated iPhoto ‘09.  iPhoto has a new feature called Faces, which is a face recognition technology that identifies faces in your photos and allows you to assign a name to each face.  This allows you to sort and view photos based on a person or group of people…..very handy.

After you install iLife ‘09 and start iPhoto ‘09 for the first time, iPhoto will scan all your photos and identify what part of each photo may be a face.  This process can be lenghy, so be patient.

After poking around, here’s what I have found so far as to what iPhoto is doing.

iPhoto scans the library the first time it opens, and creates 2 faces .db files within the iPhoto Library:

face_blob.db
face.db

iPhoto creates Faces thumbnails files and places them in the iPhoto Library/Data folder along with the other thumbnails it creates.

For example, I have:

DSC_0202_face0.jpg
DSC_0202_face1.jpg
DSC_0202.jpg

So the DSC_0202.jpg is the thumbnail image that iPhoto had already created when the photo was first added, and the initial face scan added the other 2 images because it recognized 2 faces in that image.

If anyone finds out any other technical data on how faces works, please feel free to drop a comment and I’ll update the post.

Posted by: KB

One Response to “iPhoto ‘09: What is Faces doing behind the scenes”

  1. Darryl Says:

    OS X includes the sqlite3 database client that lets you poke around in those *.db files (which are sqlite databases). Here’s some useful queries:

    echo ’select image_key from detected_face, face_name where detected_face.face_key=face_name.face_key and name=”Luke”;’ | sqlite3 face.db

    echo ’select relativePath from SqFileInfo, SqFileImage where SqFileImage.photokey=1288 and imageType=6 and SqFileImage.primaryKey=SqFileInfo.primaryKey ;’ | sqlite3 iPhotoMain.db

    The first query dumps a list of all of the photokeys (unique identifiers for every photo in your iPhoto library) for the tag “Luke”.

    The second query lets you find the location of the original photo that matches photoKey 1288 (one of the “Luke” photos listed in the previous query.

    If and when I ever get my 200GB+ of photos sufficiently face-tagged, I plan to use those queries in conjunction with Perl and a library called exiftool to embed tags into the photos themselves as IPTC Keywords. (Meaning they will follow me whereever I take my photos, be it Aperture, Lightroom, Flickr, SmugMug, whatever.)

    I’ll get around to publishing the Perl scripts when I finish writing ‘em.

Leave a Reply

Original WP Theme by N.Design Studio
Entries RSS Comments RSS Log in