I am trying to convert this curl command :
curl -X POST -F "[email protected]" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/detect_faces?api_key={apikey}&version=2016-05-20"
to a python post request.
used this example in the manual but I'm still getting a no files uploaded error.
url = {'https://gateway-a.watsonplatform.net/visual-recognition/api/v3/detect_faces'}
images= {'images_file': ('prez.jpg', open('prez.jpg', 'rb'))}
payload = {'api_key': {apikey}, 'version':'2016-05-20'}
r = requests.post(url, files = images, params = payload)
print(r.text)
Here is the return from the Watson API:
{
"error": {
"code": 400,
"description": "No images were specified.",
"error_id": "input_error"
},
"images_processed": 1
}
Am I uploading the file correctly? The curl command works fine so it's probably not the image that's the problem.