Rekognizing patterns

Introducción a AWS Boto en Python

Maksim Pecherskiy

Instructor

Rekognition

Rekognition

Introducción a AWS Boto en Python

So what is Rekognition anyway?

Detecting Objects in an image

Detect objects in image

Extracting Text from Images

Extract text from image

Introducción a AWS Boto en Python

Why not build our own?

Use Rekognition if:

  • Quick but good
  • Keep code simple
  • Recognize many things

Build a model if:

  • Custom requirements
  • Security implications
  • Large volumes

Rekognition screenshot

Introducción a AWS Boto en Python

I am not a computer vision expert

Not a Computer Vision Expert

Introducción a AWS Boto en Python

Aws Docs

Introducción a AWS Boto en Python

BOTO DOCUMENTATION

Introducción a AWS Boto en Python

BOTO DOCUMENTATION

Introducción a AWS Boto en Python

BOTO DOCUMENTATION

Introducción a AWS Boto en Python

Upload an image to S3

Initialize S3 Client

s3 = boto3.client(
  's3', region_name='us-east-1', 
  aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET
)

Upload a file

s3.upload_file(
  Filename='report.jpg', Key='report.jpg', 
  Bucket='datacamp-img')
Introducción a AWS Boto en Python

Object detection

Initiate the client
rekog = boto3.client(
  'rekognition',
  region_name='us-east-1', 
  aws_access_key_id=AWS_KEY_ID, 
  aws_secret_access_key=AWS_SECRET)

Initiate the Rekognition client

Introducción a AWS Boto en Python

Object detection

Detect!
response = rekog.detect_labels(
  Image={'S3Object': {
          'Bucket': 'datacamp-img', 
          'Name': 'report.jpg'
        },

MaxLabels=10, MinConfidence=95 )

Object detection

Introducción a AWS Boto en Python

Detect labels response

Introducción a AWS Boto en Python

Detect labels response

Introducción a AWS Boto en Python

Detect Labels Response

Introducción a AWS Boto en Python

Detect Labels Response

Introducción a AWS Boto en Python

Detect Labels Response

Introducción a AWS Boto en Python

Text detection

Perform detection
response = rekog.detect_text(
  Image={'S3Object': 
          {
            'Bucket': 'datacamp-img', 
            'Name': 'report.jpg'
          }
        }
)

Text detection response

Introducción a AWS Boto en Python

Text detection response

Introducción a AWS Boto en Python

Text detection response

Introducción a AWS Boto en Python

Text detection response

Introducción a AWS Boto en Python

Summary

  • Detect objects in an image
  • Count instances
  • Learn a new AWS Service

Rekognition

.detect_labels()

  • Recognize text in an image
  • Word vs line detections
  • When to build our own

Text detection

.detect_text()

Introducción a AWS Boto en Python

Let's do some computer vision!

Introducción a AWS Boto en Python

Preparing Video For Download...