2017-08-21 59 views
0

我試圖使用aws的識別服務。圖像被成功拍攝並上傳到S3。但由於某些端點url無法識別。我檢查this,我的地區是正確的。AWS S3 - 無法連接到終點網址

錯誤消息:botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://rekognition.us-east-2.amazonaws.com/"

去翻doc知道我的終點應該是這樣s3-us-east-2.amazonaws.com

對不起,我是新手,請隨時指出所犯的任何錯誤。在此先感謝

蟒蛇

def detect_labels(bucket, key, max_labels=10, min_confidence=90, region="us- 
east-2"): 
    rekognition = boto3.client("rekognition",region) #tried change rekognition to 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) 
for label in detect_labels(BUCKET,file_name): 
    print("{Name} - {Confidence}%".format(**label)) 

回答