辨識模式

Python 中的 AWS Boto 入門

Maksim Pecherskiy

Instructor

Rekognition

Rekognition

Python 中的 AWS Boto 入門

那 Rekognition 到底是什麼?

偵測影像中的物件

在影像中偵測物件

從影像擷取文字

從影像擷取文字

Python 中的 AWS Boto 入門

為什麼不自己做?

適合用 Rekognition:

  • 快速且效果好
  • 程式碼要簡單
  • 需辨識多種項目

適合自行建模:

  • 客製需求
  • 牽涉安全
  • 量體很大

Rekognition 螢幕截圖

Python 中的 AWS Boto 入門

我不是電腦視覺專家

不是電腦視覺專家

Python 中的 AWS Boto 入門

Aws Docs

Python 中的 AWS Boto 入門

BOTO DOCUMENTATION

Python 中的 AWS Boto 入門

BOTO DOCUMENTATION

Python 中的 AWS Boto 入門

BOTO DOCUMENTATION

Python 中的 AWS Boto 入門

將影像上傳到 S3

初始化 S3 用戶端

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

上傳檔案

s3.upload_file(
  Filename='report.jpg', Key='report.jpg', 
  Bucket='datacamp-img')
Python 中的 AWS Boto 入門

物件偵測

啟動用戶端
rekog = boto3.client(
  'rekognition',
  region_name='us-east-1', 
  aws_access_key_id=AWS_KEY_ID, 
  aws_secret_access_key=AWS_SECRET)

啟動 Rekognition 用戶端

Python 中的 AWS Boto 入門

物件偵測

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

MaxLabels=10, MinConfidence=95 )

物件偵測

Python 中的 AWS Boto 入門

detect_labels 回應

Python 中的 AWS Boto 入門

detect_labels 回應

Python 中的 AWS Boto 入門

detect_labels 回應

Python 中的 AWS Boto 入門

detect_labels 回應

Python 中的 AWS Boto 入門

detect_labels 回應

Python 中的 AWS Boto 入門

文字偵測

執行偵測
response = rekog.detect_text(
  Image={'S3Object': 
          {
            'Bucket': 'datacamp-img', 
            'Name': 'report.jpg'
          }
        }
)

文字偵測回應

Python 中的 AWS Boto 入門

文字偵測回應

Python 中的 AWS Boto 入門

文字偵測回應

Python 中的 AWS Boto 入門

文字偵測回應

Python 中的 AWS Boto 入門

重點整理

  • 偵測影像中的物件
  • 計算實例數
  • 學會一個新的 AWS 服務

Rekognition

.detect_labels()

  • 辨識影像中的文字
  • 字與行的偵測
  • 何時該自行建模

文字偵測

.detect_text()

Python 中的 AWS Boto 入門

開始做電腦視覺吧!

Python 中的 AWS Boto 入門

Preparing Video For Download...