Skip to content

Instantly share code, notes, and snippets.

@dougtoppin
Last active June 7, 2018 09:17
Show Gist options
  • Save dougtoppin/7207d72e8e1eda6dcd116f2b73e26ed9 to your computer and use it in GitHub Desktop.
Save dougtoppin/7207d72e8e1eda6dcd116f2b73e26ed9 to your computer and use it in GitHub Desktop.
Amazon rekognition service usage via the aws cli

Rekognition

Amazon announced their Rekognition image analysis service in Nov-2016. The documentation page at that time did not include a specific example of how to use it via the aws cli so I thought that it might be helpful to show an example.

The aws cli must already be setup and usable.

The picture is of my dog laying down and waiting for his dinner.

Replace bucketname and imagename with an s3 bucket and image file that are accessible to the cli.

Usage:

aws rekognition detect-labels --image='{"S3Object": { "Bucket": "bucketname", "Name": "imagename" } }'

Response

{
"Labels": [
    {
        "Confidence": 64.35530090332031,
        "Name": "Animal"
    },
    {
        "Confidence": 64.35530090332031,
        "Name": "Canine"
    },
    {
        "Confidence": 64.35530090332031,
        "Name": "Dog"
    },
    {
        "Confidence": 64.35530090332031,
        "Name": "Mammal"
    },
    {
        "Confidence": 64.35530090332031,
        "Name": "Pet"
    },
    {
        "Confidence": 64.35530090332031,
        "Name": "Pointer"
    },
    {
        "Confidence": 62.247352600097656,
        "Name": "Beagle"
    },
    {
        "Confidence": 62.247352600097656,
        "Name": "Hound"
    }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment