Learn AWS Rekognition
What is AWS Rekognition?
Amazon Rekognition is a solution for image and video analysis, a software in the category Artificial Intelligence / Machine Learning which uses deep learning machines to recognize objects in an image. It is a highly scalable application that can interpret the image easily, and recognize the objects in the image or video.
It takes no understanding of machine learning to use and the computer vision scientists at Amazon are actively reviewing new images and videos behind the scenes, refining the deep learning algorithm, and introducing new capabilities to the app.
How to use AWS Rekognition
While the AWS Console involves some minimal contact with AWS Rekognition, the implementation of Rekognition is basically applied via the SDK.
The image and video can be sent directly via the API call by using the SDK, or by forwarding a URL to an object that is stored in S3. If the image bytes are sent to the API, the image must be encoded as Base64, which is automatically executed for you in certain languages. For moving an S3 object then the Base64 encoding does not need to be done.
Settings for AWS Rekognition
To set up Rekognition, you must have access to AWS, download the Software Development Kit ( SDK) for the programming language you want, and execute your code. so let's do some settings for AWS Rekognition and start writing some code for it.
Step 1: Firstly log in to the AWS console as shown in the previous blog, and then your dashboard will be open go to services option and then select the first IAM role because we are going to use lambda integrated with Rekognition and S3 bucket.
Step 2: On the left side of the of your screen on your dashboard choose Role options as shown in the below image.
Step 3: After that click on the create role button.
Step 4: choose the service for which you are going to create a role, here we are going to choose lambda function, as marked in the below image and then click on the Next permission button downside.
Step 5: select the permission policies which you want to give access to the lambda function. here we are going to select the policies for Rekognition, S3, and other machine learning policies and then click on Next Tags button.
Step 6: give the role name and description and you can see the policies we have attached for our lambda function as shown in the below image and then click on the create role button.
Step 7: Now we have to create an S3 bucket where we are going to upload our image data, go to S3 bucket, and click on the create bucket button as shown in the below image.
Step 8: give your bucket name and select region and then click on the create bucket button as shown in the below image.
Note: if you are new to AWS and don't know how to create an S3 bucket you can read our previous blog.
step 9: your S3 bucket is created as shown in the below image.
Step 10: Now go to Lambda function and create one lambda function as shown in the below image how we have created.
Note: if you don't know how to create the lambda function read our previous blog.
Step 11: Go to the code section and start writing the code as shown in the below image. we are using here S3 and Rekognition and save the code after writing your code as marked in the below image.
Step 12: Go to the S3 bucket that you have created and upload the image as we have uploaded the image of sheep.png.
Step 13: and then click on the test button in the lambda function as marked in the below image.
Step 14: As you can see in the below image the success message and can see the below marked how it is detecting the things in the image like sweets, plants, etc.
The below image was the image sheep.png.
Step 15: Let's try with some other image, here we are going to upload the parrot image to the S3 bucket and now we will try again.
This is the image below.
Step 16: You can see the below image it is detecting correctly the parrot image as marked in the red.
This is how we use Rekognition service to detect the image objects, you can explore it more by connecting with other services. hope this blog will be helpful for you!!!!!
Keep reading!!!!!!