我尝试使用自定义视觉服务。
响应此错误消息:
{"代码":"BadRequestImageFormat","消息":""}
附上我的代码和测试的图像文件
请检查这个并帮助我
<form id="imageform" method="POST" enctype="multipart/form-data">
<input type="file"/>
</form>
var data = new FormData(document.getElementById('imageform'));
var url = "https://southcentralus.api.cognitive.microsoft.com/customvision/v1.0/Prediction/my-key/image";
$.ajax({
url : url,
data : data,
processData : false,
contentType : "multipart/form-data",
headers : {
'Prediction-key' : 'key'
},
type : 'POST',
success : function(response) {
var result = response["Predictions"];
buildResult(result);
},
error : function(request, status, error) {
}
});
我参考了这个文件。