AWSReckognitionToomanyRowsinmanifestError
创始人
2024-09-26 20:01:45
0
  1. 使用AWS SDK或CLI上传S3时,请确保manifest文件不超过5000行。
  2. 可以将manifest文件拆分为多个文件,以确保每个文件行数不超过5000。
  3. 使用AWS Rekognition时,请确保使用正确的文件格式和参数,以确保上传的数据符合要求,参考以下代码示例:
import boto3
import os
import codecs
import json

rekognition = boto3.client('rekognition')

bucket = "my-bucket"
photos = ["photo1.jpg", "photo2.jpg", "photo3.jpg"]
manifest_filename = "my-manifest-file.json"

manifest = []
for photo in photos:
    full_path = os.path.join(bucket, photo)
    manifest.append({"source-ref": full_path})

#Write the manifest to disk
with codecs.open(manifest_filename, 'w', encoding="utf8") as json_file:
    json_file.write(json.dumps(manifest, ensure_ascii=False))

#Upload the manifest file and the images to Amazon S3
s3 = boto3.resource('s3')
s3_bucket = s3.Bucket(bucket)
s3_bucket.upload_file(manifest_filename, manifest_filename)

for photo in photos:
    s3_bucket.upload_file(photo, photo)

#Start the search using Amazon Rekognition
response = rekognition.start_face_search(Video = {"S3Object": {"Bucket": bucket, "Name": "my-video.mp4"}},
                                         FaceMatchThreshold = 80,
                                         CollectionId = "my-collection-id",
                                         JobTag = "my-job-tag",
                                         NotificationChannel = {"RoleArn": "arn:aws:iam::0123456789012:role/my-notification-role", "SNSTopicArn": "arn:aws:sns:us-east-1:0123456789012:my-topic"})
        
job_id=response['JobId']
print('Started job:' + job_id)

在这个例子中,我们制作了一个搜索视频中人脸的示例,其中上传了多个图像并使用了一个manifest文件。该文件是包含每个图像S3位置的JSON文件。请注意manifest文件必须少于或等

相关内容

热门资讯

透视app!hhpoker辅助... 透视app!hhpoker辅助软件,决战卡五星辅助器下载,安装教程(有挂技巧);亲真的是有正版授权,...
发现一款!epoker外挂,微... 发现一款!epoker外挂,微扑克ai机器人,2025新版(先前是有挂)1、很好的工具软件,可以解锁...
透视好友房!红龙poker辅助... 透视好友房!红龙poker辅助,广东雀神智能插件,2025新版总结(有挂透明);广东雀神智能插件软件...
一分钟教会你!wepoke人有... 您好,微扑克辅助软件这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家在这...
透视脚本!hhpoker怎么开... 透视脚本!hhpoker怎么开透视,游戏挂机辅助软件,技巧教程(有挂技巧);《WPK辅助透视》‌:支...
总算明白!wopoker游戏辅... 总算明白!wopoker游戏辅助器,aapoker有猫腻,必备教程(原先是有挂)是一款可以让一直输的...
透视游戏!智星德州菠萝透视插件... 《透视游戏!智星德州菠萝透视插件工具,钱塘十三水有透视功能吗,2025新版教程(有挂方法)》 钱塘十...
最新研发!aapoker系统机... 最新研发!aapoker系统机制,德扑ai助手,科技教程(竟然是有挂);小薇(透视辅助)致您一封信;...
透视教程!aapoker透视插... 透视教程!aapoker透视插件下载,闲逸游戏游透视吗,详细教程(有挂方法);人气非常高,ai更新快...
让我来分享经验!wpk胜率跟号... 您好,德扑之星辅助器购买这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩家...