Jump to content

Facial Recognition with AWS


Dan Syring

Recommended Posts

Wanted to share a solution I created using AWS or facial recognition and tagging.  This is just the spark notes on my flow - let me know if interested in code snippets or a more detailed write-up.  There are a couple solutions using lightroom and the old picasa.  When testing AWS rekognition worked WAYYYY better.

I am using daminion server for home - use case is photos from family members phones, gopro, drone in one place easy to access.

Process

Create Database of Faces in AWS

1 time step, or multiple times when adding new faces/people

AWS requires an index of faces that it uses to match.  I took individual pictures of people I wanted to tag cropped them to only have the subject's face and indexed them using aws's boto3 module in python.  Here I specified the 'external parameter id' field as '[lastname]|[firstname]'.  That way when there is a match I have the exact tag that will be added to the photo and recognizable by daminion

Match Photo

The process for a single photo is as follows:

  1. Index faces in the photo (the faces will be indexed with the collection created prior) (python boto3)
  2. loop through the faces and find matches (python boto3)
  3. Matches are returned as %match.  If 95% or higher save tag and move onto the next photo, if less then 95-80% tag all matched faces.  Here I error'd on the side of more false positives vs more false negatives
  4. Use exiftool to add all the tags saved in step 3

Automation

I have a SMB drop box.  All users drop photos into the box either manually or automatically with owncloud or nextcloud.

Every hour a scheduled task is run that:

  1. adds create_date to photo name if not included (iphone for example does not have a unique timestamp in file name)
  2. if file does not exist in catalog continue, otherwise delete
  3. search and tag faces in photo with python script above
  4. move photo to proper picture storage location
  5. Daminion file watching service adds it to the catalog

 

This is for all new photos, for historical photos I used a python script to scan and tag all of them.  I also add a tag of face_detected if a face was detected but no match was found.  This allows for re-scanning in the event you update your face index and want to rescan.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...