A little journey into AWS Rekognition

How to recognize objects with AWS

AWS Rekognition is the API as Service from AWS to recognize objects

Salvatore Cozzubo

--

Photo by DeepMind on Unsplash

Hello, I have recently built a telegram bot that identifies an object present in an image sent by user. The service to achieve this purpose is AWS Rekognition.

What is AWS Rekognition?

From the AWS Rekognition’s overview page: “Amazon Rekognition is a service that makes it easy to add powerful visual analysis to your applications. Rekognition Image lets you easily build powerful applications to search, verify, and organize millions of images.”

What can it do?

Rekognition has some interesting features:

  • Face Comparison, to detect and store face. If you upload a new image with the same face it can be recognize.
  • Facial Analysis, to get a complete analysis of a face. It can detect if one is smiling, wearing glasses or a possible age range.
  • Image Moderation, to detect sensibile content in a picture.
  • Label Detection, to recognize objects and attach a label for a specific object.

And much more like: Celebrity recognitions, Text in image and PPE detection (Personal Protective Equipment).

AWS Rekognition can also detect objects in a video or a streaming video.

A practical example

Thanks to Rekognition we can obtain the information of the object from an image. There are two ways to get labels from image: store the image to bucket S3 o use a base64 encoded-string.

You can setup a level of confidence to discard false positive. In our case I set MaxLabelsto 20 and MinConfidenceto 75. This means that it retrieves the best 20 labels with a confidence over than 75%.

As response you will get a list of labels from the image, confidence and the bounding box.

This cool service gave me a good idea for a telegram bot. The user sends a message with picture to a bot and then it answers with a phrase to indicate if an object is present or not. If you remember it’s like the “Not hotdog” app from Silicon Valley, TV Series.

I have done this bot and uploaded it on a serverless repository application, you can add keywords and the bot will try to find the object in the picture.

Let’s try and give me some feedback. Check out the previous article.

Goodbye and see you soon.

--

--