I am accessing google vision api using requests.post method in python (jupyter notebook)
in imageUri i can only specify weburl or bucket uri. I cannot specify local file name like "/Users/pi/test.jpg"
file_name = '/Users/mbp/Pictures/full moon.jpg'
data = {
"requests":[
{
"image":{
"source":{
"imageUri": file_name
}
},
"features":[
{
"type":"FACE_DETECTION",
"maxResults":1
}
]
}
]
}
r = requests.post(url=url,json=data)
x= json.loads(r.text)
print(x['responses'])
response i get is:
[{'error': {'code': 3, 'message': 'image-annotator::Malformed request.: Unsupported URI protocol specified: /Users/mbp/Pictures/full moon.jpg'}}]
please help