如何使用 OpenCV (cv2.imread) 从 S3 读取图像?

时间:2021-04-20 02:40:10

标签: python amazon-web-services opencv amazon-s3 image-processing

我无法从 S3 存储桶读取图像。我可以像这样在本地读取图像。

def load_image(path):
    image = cv2.imread(path)
    image = cv2.resize(image, (224, 224))
    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
    return image

for image_path in os.listdir(path):
    image = load_image(path + "/" + image_path)
    X.append(image)

但我不知道为什么 S3 说错误

TypeError: Can't convert object of type 'list' to 'str' for 'filename'

0 个答案:

没有答案