Yes, Google Cloud Vision API Accepts external URL images. I just used this image to get the labels:
python label_sample.py -u "https://upload.wikimedia.org/wikipedia/commons/e/e6/Bleeding_finger.jpg" Found label: red with 96.47 percent probability!!!!!!!!!!! Found label: color with 95.46 percent probability!!!!!!!!!!! Found label: pink with 92.15 percent probability!!!!!!!!!!! Found label: finger with 91.06 percent probability!!!!!!!!!!! Found label: hand with 90.45 percent probability!!!!!!!!!!! Found label: nail with 73.23 percent probability!!!!!!!!!!! Found label: lip with 73.09 percent probability!!!!!!!!!!! Found label: jewellery with 68.84 percent probability!!!!!!!!!!! Found label: produce with 68.39 percent probability!!!!!!!!!!! Found label: macro photography with 67.86 percent probability!!!!!!!!!!!
You must specify it in the correct format using the urllib library and comment on the image opening part as follows:
url = url_file opener = urllib.urlopen(url) # with open(photo_file, 'rb') as image: image_content = base64.b64encode(opener.read())
muglikar
source share