AWS Rekognition AWS Rekognition | Nisha Selvarajan
AWS Rekognition AWS Rekognition | Nisha Selvarajan

Detect Objects and Text in an Image

What is AWS Rekognition?

Amazon Rekognition is an image and video analysis solution in the Artificial Intelligence/Machine Learning category. It uses machine deep learning to identify objects in an image. Amazon Rekognition is a highly scalable solution capable of quickly analyzing the image and identifying the objects in the image or video. It requires no knowledge of machine learning to use, and behind the scenes Amazon’s computer vision scientists are constantly analyzing new images and videos, improving upon the deep learning model and adding new features to the service.

Let's Start!

When working with the AWS Java SDK, there’s a basic pattern that you’ll follow. It goes like this:

  • Get a copy of the client that’s making a connection to the service you want to use.
  • Create a “request” object.
  • Fill the “request” object with the parameters (or other objects) you need to supply.
  • Tell the client to make the request.
  • Get back a “response” object.

    This was the case when working with Rekognition.

    Here are the steps for detecting the labels (objects, locations, activities) in an image:

  • Get a copy of the Rekognition AWS client.
  • Create a “DetectLabelsRequest / DetectTextRequest / DetectCustomLabelsRequest” object.
  • Create an “Image” object in the Rekognition service to work with.
  • Set the Image object into the DetectLabelsRequest / DetectTextRequest / DetectCustomLabelsRequest.
  • Run the DetectLabelsRequest.
  • Get back a DetectLabelsResult object.

    Amazon Rekognition Custom Labels lets you extend the detection and classification capabilities of the Amazon Rekognition pre-trained APIs by using data to train a custom CV model specific to your business needs. With the latest update to support single object training, Amazon Rekognition Custom Labels now lets you create a custom object detection model with single object classes. To create our custom model, we follow these steps:

  • Create a project in Amazon Rekognition Custom Labels.
  • Create a dataset with images containing one or more images related to your business needs.
  • Label the images by applying bounding boxes on all pizzas in the images using the user interface provided by Amazon Rekognition Custom Labels.
  • Train the model and evaluate the performance.
  • Test the new custom model using the automatically generated API endpoint.
  • Amazon Rekognition Custom Labels lets you manage the ML model training process on the Amazon Rekognition console, which simplifies the end-to-end process.
  • Use DetectCustomLabelsRequest to create request for querying custom model.

    Above Steps are translated into code below : Glimse Of Data Glimse Of Data

    I have recorded the output from Amazon Rekognition using predefined & custom trained models.