Ошибка предварительных условий Amazon Rekognition DetectText - PullRequest
0 голосов
/ 30 апреля 2019

Я хочу получить текст с изображения с помощью Amazon rekognition api.

Вот мой код:

bucket='my-project'
photo='my-image.jpg'
client=boto3.client('rekognition', 's3-ap-southeast-1')
response=client.detect_text(Image={'S3Object':{'Bucket':bucket,'Name':photo}})

Тем не менее, он показывает ошибку:

File "C:\Users\Chan\AppData\Roaming\Python\Python37\site-packages\botocore\client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (412) when calling the DetectText operation:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>PreconditionFailed</Code>
  <Message>At least one of the pre-conditions you specified did not hold</Message>
  <Condition>Bucket POST must be of the enclosure-type multipart/form-data</Condition>
  <RequestId>BAED284813213F69</RequestId>
  <HostId>grt34dS34dgecadsfrrwer424234dxfgKyO1/sdf423sdfshoprtld=</HostId>
</Error>

Как решить проблему?

...