Reconnaître des motifs

Introduction à AWS Boto en Python

Maksim Pecherskiy

Instructor

Rekognition

Rekognition

Introduction à AWS Boto en Python

Mais au fait, qu'est-ce que Rekognition ?

Détection d'objets dans une image

Détecter des objets dans une image

Extraire du texte d'images

Extraire du texte d'une image

Introduction à AWS Boto en Python

Pourquoi ne pas construire le nôtre ?

Utilisez Rekognition si :

  • Rapide mais fiable
  • Code simple
  • Reconnaître de nombreux éléments

Créez un modèle si :

  • Besoins spécifiques
  • Enjeux de sécurité
  • Gros volumes

Capture d'écran Rekognition

Introduction à AWS Boto en Python

Je ne suis pas expert en vision par ordinateur

Pas expert en vision par ordinateur

Introduction à AWS Boto en Python

Docs AWS

Introduction à AWS Boto en Python

Documentation BOTO

Introduction à AWS Boto en Python

Documentation BOTO

Introduction à AWS Boto en Python

Documentation BOTO

Introduction à AWS Boto en Python

Téléverser une image sur S3

Initialiser le client S3

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

Téléverser un fichier

s3.upload_file(
  Filename='report.jpg', Key='report.jpg', 
  Bucket='datacamp-img')
Introduction à AWS Boto en Python

Détection d'objets

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

Initialiser le client Rekognition

Introduction à AWS Boto en Python

Détection d'objets

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

MaxLabels=10, MinConfidence=95 )

Détection d'objets

Introduction à AWS Boto en Python

Réponse de détection des labels

Introduction à AWS Boto en Python

Réponse de détection des labels

Introduction à AWS Boto en Python

Réponse de détection des labels

Introduction à AWS Boto en Python

Réponse de détection des labels

Introduction à AWS Boto en Python

Réponse de détection des labels

Introduction à AWS Boto en Python

Détection de texte

Effectuer la détection
response = rekog.detect_text(
  Image={'S3Object': 
          {
            'Bucket': 'datacamp-img', 
            'Name': 'report.jpg'
          }
        }
)

Réponse de détection de texte

Introduction à AWS Boto en Python

Réponse de détection de texte

Introduction à AWS Boto en Python

Réponse de détection de texte

Introduction à AWS Boto en Python

Ce que voit Rekognition

Introduction à AWS Boto en Python

Résumé

  • Détecter des objets dans une image
  • Compter les occurrences
  • Découvrir un nouveau service AWS

Rekognition

.detect_labels()

  • Reconnaître du texte dans une image
  • Mots vs lignes détectés
  • Quand construire le nôtre

Détection de texte

.detect_text()

Introduction à AWS Boto en Python

Faisons un peu de vision par ordinateur !

Introduction à AWS Boto en Python

Preparing Video For Download...