猫咪检测器
由于 Sam 的人气和成绩越来越高,她接到的项目也越来越有挑战性。
最新的需求来自动物管理团队。他们希望当 Get It Done 应用上传的图片中包含猫时能收到通知。这样他们就能发现流浪猫并及时救助。团队提供了两张图片供她测试系统使用:一张含有猫,一张不含。两张图片分别保存在变量 image1 和 image2 中。
Sam 还已在变量 rekog 中创建了 boto3 的 Rekognition 客户端。
请帮助 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'])