2017-01-07 10 views
4

AWS Image Rekognition APIを使用して画像内の顔を検出しようとしています。Amazon Rekognition API - S3メタデータの問題

ERROR1:

ClientError: An error occurred (InvalidS3ObjectException) when calling the DetectFaces operation: Unable to get image metadata from S3. Check object key, region and/or access permissions. 

PythonのCODE1:

def detect_faces(object_name="path/to/image/001.jpg"): 
    client = get_aws_client('rekognition') 

    response = client.detect_faces(
     Image={ 
      # 'Bytes': source_bytes, 
      'S3Object': { 
       'Bucket': "bucket-name", 
       'Name': object_name, 
       'Version': 'string' 
      } 
     }, 
     Attributes=[ 
      'ALL', 
     ] 
    ) 

    return response 

オブジェクト "パス/に/画像/ 001.JPGは" AWS S3バケット「バケツに存在する。しかし、次のエラーを取得-名"。また、地域名も正しいです。

このオブジェクト '001.jpg'のパーミッションは次のとおりです。誰もがオープン/ダウンロード/表示権限を与えられています。 オブジェクトのメタデータ:コンテンツタイプ:image/jpeg

これをデバッグする方法がわかりません。これを解決するための提案はどうですか?

おかげで、

答えて

3

あなたはstringのバージョンIDを持つオブジェクトを取得するためにサービスを求めているように見えます。

Version

If the bucket is versioning enabled, you can specify the object version.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

http://docs.aws.amazon.com/rekognition/latest/dg/API_S3Object.html#rekognition-Type-S3Object-Version

あなたが本当に、問題のオブジェクトの実際のバージョン番号を提供する場合には、バージョンバケットからのオブジェクトの特定のバージョンを取得する場合を除き、あなたのリクエストパラメータから'Version': 'string'を削除します。

+0

ありがとうございました。 – Naveen