我正在尝试对图像进行分类,并跟踪这个文档。下面是我的cURL命令:
curl -X POST -F "images_file=~/fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key=12fdsxxxxxxxsadasdxxxxxxdsa45654&version=2016-05-20"我从沃森那里得到了这样的答复:
{
"error" : {
"code": 400,
"description": "No images were specified.",
"error_id": "input_error"
},
"images_processed":0
}我的图像在C:/User/Rajesh Kumar/中,cURL在Rajesh Kumar@RAJESH_KUMAR ~中执行。我知道问题在cURL命令中,但不知道是什么。请帮我解决这个问题。
提前感谢!
发布于 2016-07-15 07:37:25
确保您与fish.jpg位于同一个目录中。然后运行以下命令(替换API键):
curl -X POST -F "images_file=@fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key={api-key}&version=2016-05-20"别用蒂尔达。
只是试了一下,结果成功了--以下是步骤:
步骤1:
下载此文件,并将其保存为fish.jpg

步骤2:
确保您位于正确的目录中:

步骤3:
在此命令中替换API键并运行它:
curl -X POST -F "images_file=@fish.jpg" "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key={api-key}&version=2016-05-20"步骤4:
☺☺☺

https://stackoverflow.com/questions/38388412
复制相似问题