我正在尝试使用 Microsoft 的自定义视觉 API,但我遇到的只是 404 错误。如何使用 API?
我尝试复制、粘贴和修改 Python 和 Javascript 示例的预测部分,例如在此处找到的示例:https ://github.com/Azure-Samples/cognitive-services-node-sdk-samples/blob/master /Samples/customvision/customVisionImgClassify.js
将预测 URL 从自定义视觉的性能页面复制并粘贴到我的浏览器中,即:
https://japaneast.api.cognitive.microsoft.com/customvision/v3.0/Prediction/999999999999999/classify/iterations/Iteration4/image
,产生相同的 404 错误:
{ "error":{ "statusCode": 404, "message": "Resource not found" }}
我最接近成功访问 API 的是通过 Azure Logic App,它使用旧版本的自定义视觉:
/customvision/v1.0/Prediction/99999999999999999/image
此访问方法会产生“未经授权”错误而不是 404。
我尝试在 Azure Logic App 中修改 JSON 以使用较新版本的自定义视觉,但又收到 404 错误。有关 JSON,请参见下文(我将键和 ID 替换为 9):
"Predict_tags_from_image": {
"inputs": {
"body": "@triggerBody()",
"headers": {
"Content-Type": "application/octet-stream",
"Prediction-Key": "9999999999999"
},
"host": {
"connection": {
"name": "@parameters('$connections')['cognitiveservicescustomvision_1']['connectionId']"
}
},
"method": "post",
"path": "https://japaneast.api.cognitive.microsoft.com/customvision/v3.0/Prediction/9999999999999/classify/iterations/Iteration4/image"
},
"runAfter": {
"Create_file": [
"Succeeded"
]
},
"type": "ApiConnection"
}
提前感谢您对此的任何帮助!