how to implement "similar product images" in Amazon Rekognition

530 views Asked by At

i am using Amazon Rekognition when i upload an image to my s3 bucket , the api resonse i get is

{
    "Labels": [
        {
            "Confidence": 99.30213165283203,
            "Name": "Human"
        },
        {
            "Confidence": 99.30457305908203,
            "Name": "People"
        },
        {
            "Confidence": 99.30457305908203,
            "Name": "Person"
        },
        {
            "Confidence": 92.39805603027344,
            "Name": "Clothing"
        },
        {
            "Confidence": 92.39805603027344,
            "Name": "Denim"
        },
        {
            "Confidence": 92.39805603027344,
            "Name": "Jeans"
        },
        {
            "Confidence": 92.39805603027344,
            "Name": "Pants"
        },
        {
            "Confidence": 51.34967041015625,
            "Name": "Accessories"
        },
        {
            "Confidence": 51.27912902832031,
            "Name": "Footwear"
        },
        {
            "Confidence": 51.27912902832031,
            "Name": "Shoe"
        }
    ],
    "OrientationCorrection": "ROTATE_0"
}

is there any api to search for similar product (eg. search: 'striped blue t shirts' when i upload a blue striped tshirt) among images in my bucket.

2

There are 2 answers

0
Chris Adzima On

Rekognition alone would not have that search, but you could create a small RDS database that keeps the above results in relation to the individual images, then when you do a Rekognition search you can also do a quick query for images that have the same tags.

0
Noel Llevares On

Here's a suggestion on how to set it up.

  1. S3 upload calls a Lambda function.
  2. Lambda uses Rekognition to get possible labels for uploaded image.
  3. Rekognition returns the labels.
  4. Lambda stores labels into a DB (RDS, Dynamo, or ElasticSearch, etc.)

For your API, you can also create an API Gateway and Lambda-powered API that will connect to the above DB and retrieve matches for you.