0
votes

I have an android app which uploads images taken by the camera to AWS S3. I would like to be able to keep the image if it contains the face of the user, and only the face of the user. (ie a selfie - unfortunately android does not save which camera was used in EXIF data).

I have found code to do this on android, but that seems like an unnecessary amount of network calls. Seeing as I am using S3, it seems like there should be away to have S3 do if for me automatically. Ie, every image uploaded to a folder is automatically run through Rekog, stored if the same as reference image and deleted otherwise.

The service is so new however, the documentation rather sparse, than I cannot find any docs describing if this is possible. Does anyone know?

2

2 Answers

3
votes

You can do the following:

S3 upload event -> trigger lambda -> calls Rekognition CompareFaces API -> based on Confidence score threshold -> decides to delete or retain.

Points to note:

  • You need to have a reference image stored in S3
  • If there are too many images uploaded, you can see if AWS Batch is better suited, if you are OK with not doing it real time, then spot instances should be preferable.
0
votes

I'm working with Rekognition as well. As best I can tell from your question, ComparesFaces or SearchFaces could be used to determine whether to store or delete the image. As far as how to get Rekog auto-run on a specific folder I guess it could start with S3 invoking Lambda but I'm not sure what additional AWS services would be required beyond...