2
我使用下面的代码:基于如何从图像url(jpeg)读取字节并在Python 2.7中对base64进行编码?
import urllib, cStringIO
from PIL import Image
url='https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png'
file = cStringIO.StringIO(urllib.urlopen(url).read())
img = Image.open(file)
:How do I read image data from a URL in Python?
现在我需要Base64编码,它发布到谷歌云愿景API。怎么做?
或者Google云视觉API是否可以与图像网址一起使用?