python - AWS S3 - Could not connect to the end point url -


i'm trying use recognition service aws. image taken , uploaded s3. unable recognition due end point url. check this, , region correct.

error message:botocore.exceptions.endpointconnectionerror: not connect endpoint url: "https://rekognition.us-east-2.amazonaws.com/"

look through doc know end point should s3-us-east-2.amazonaws.com.

sorry new this, please feel free point out mistake had made. in advance

python

def detect_labels(bucket, key, max_labels=10, min_confidence=90, region="us- east-2"):   rekognition = boto3.client("rekognition",region) #tried change rekognition s3   response = rekognition.detect_labels(     image={       "s3object": {          "bucket": bucket,         "name": key,       }       },     maxlabels=max_labels,     minconfidence=min_confidence,   )    return response['labels']  takephoto(file_path, file_name) uploadtos3(file_path,file_name, bucket,location) label in detect_labels(bucket,file_name):   print("{name} - {confidence}%".format(**label)) 

amazon rekognition available in 3 regions, currently: us-east-1, us-west-2, , eu-west-1.

http://docs.aws.amazon.com/general/latest/gr/rande.html#rekognition_region

your bucket needs located in region using rekognition.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -