【发布时间】:2017-07-20 21:42:29
【问题描述】:
我在 Windows 10 上使用 Python 2.7 剪辑图像,并希望将它们发送到 Google 的 Cloud Vision API。对于本地保存的图像,我可以使用 google.cloud python 模块发送它们,如下所示:
blob.upload_from_filename(filename=path)
记录在案的here
我宁愿不将每个作物保存到文件中,而是直接发送 numpy 数组。我可以将 numpy 数组更改为 str 对象并使用
blob.upload_from_string()
但是 Cloud Vision API 将无法在我的存储桶中读取它们。有什么方法可以从 python 管道传输到云存储桶而不浪费时间/空间将它们保存为中间临时对象?
【问题讨论】:
标签: python google-cloud-storage google-cloud-python