開始使用免費開始

貓咪偵測器

隨著 Sam 的知名度和成功,她接到的專案越來越具挑戰性。

最新的需求來自動物防治團隊。他們希望當 Get It Done 應用程式傳入的影像中包含貓時,能收到通知。這樣就能找到野貓並前往救援。他們提供了 2 張影像供她測試系統使用:一張有貓,一張沒有。兩張影像分別已指派在變數 image1image2 中。

Sam 也已經建立好 boto3 的 Rekognition 用戶端,存放在變數 rekog

請協助 Sam 使用 Rekognition,讓動物防治團隊能救援流浪貓!

本練習屬於課程

Python 中的 AWS Boto 入門

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Use Rekognition client to detect labels
image1_response = rekog.____(
    # Specify the image as an S3Object; Return one label
    ____=image1, MaxLabels=____)

# Print the labels
print(image1_response['Labels'])
編輯並執行程式碼