Microsoft Azure Custom Vision API nodeJS - classifyImageUrl()错误“BadRequestImageUrl” [英] Microsoft Azure Custom Vision API nodeJS - classifyImageUrl() error “BadRequestImageUrl”

查看:47
本文介绍了Microsoft Azure Custom Vision API nodeJS - classifyImageUrl()错误“BadRequestImageUrl”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我尝试通过Microsoft的API对图像进行分类(https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision- nodeJS上的service / node-tutorial。

I try atm to classify an image via the API from Microsoft (https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/node-tutorial) on nodeJS.

网络已经过培训,我可以"连接"网络。到我的算法。我想发送一个base64字符串作为dataUri然后我得到这个错误消息:"代码:BadRequestImageUrl,消息:无效的图像网址"

The network is alreaday trained and I can "connect" to the my algorithm. I want to send a base64 string as a dataUri but then I get this error-message: "Code: BadRequestImageUrl, message: Invalid image url"

变量"img"是一个base64字符串(来自FHIR-Observation-Ressource)并且正确(在网站上,url与base64一起使用)。

The variable "img" is a base64 string (from a FHIR-Observation-Ressource) and correct (on a webside the url works with the base64).

我尝试发送图像(https://来自维基百科的upload.wikimedia.org/wikipedia/commons/8/86/Killdeer_%28Charadrius_vociferus%29_copulating_-_portrait_crop.jpg)。但是我还有一个错误:"NoFoundIteration / Invalid iteration"

I try out to send a image (https://upload.wikimedia.org/wikipedia/commons/8/86/Killdeer_%28Charadrius_vociferus%29_copulating_-_portrait_crop.jpg) from Wikipedia. But then I have an other error: "NoFoundIteration / Invalid iteration"

const PredictionAPIClient = require("azure-cognitiveservices-customvision-prediction");
const predictionKey = "xxxx";
const endPoint = "https://southcentralus.api.cognitive.microsoft.com"
const projectId = "xxxxx";
const publishedName = "myMLName";
...
var img = 'iVBORw0KGgoAAAANSUhEUgAAAgAAAAJmCAYAAA...'; //base64
...
tempUrl= { url: 'data:image/png;base64,' + img };
...
predictor.classifyImageUrl(projectId, publishedName, tempUrl)
  .then((resultJSON) => {
       console.log("RESULT ######################")
       //console.log(resultJSON);})
  .catch((error) => {
       console.log("ERROR #####################");
       console.log(error);}
);

我应该从结果中获得带有JSON格式的Microsoft Azure。

I should get a JSON form Microsoft Azure with the results.

推荐答案

你好,

您能否检查一下自定义视觉门户网站的快速测试功能是否可以成功使用相同的图片网址?

Could you please check if the same image URL can be used successfully from Quick Test feature of your custom vision portal?

最近的定制愿景发生了变化服务,我们需要发布迭代并调用分类图像而不是更新迭代和预测。如果迭代未发布,则可能抛出无效的迭代错误。
nodejs  现在应该是正确的订单。

There have been recent changes in the custom vision service and we need to publish the iteration and call classify image instead of update iteration and predict. If the iteration is not published it may be throwing the invalid iteration error. The steps for nodejs should be the correct order now.

对于dataUri的问题,我不确定这是否有效,我建议检查azure SDK的节点

github
文件的实施和在github上提出同样的问题。

For the issue with dataUri I'm not sure if that works, I would suggest to check the azure SDK for node github documentation for its implementation and raise an issue on github for the same.


这篇关于Microsoft Azure Custom Vision API nodeJS - classifyImageUrl()错误“BadRequestImageUrl”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆