【问题标题】:Microsoft Face API error in method identify()方法 identify() 中的 Microsoft Face API 错误
【发布时间】:2017-09-21 17:33:02
【问题描述】:

我在 JavaScript 中使用用于 Microsoft Face API 的牛津项目,当我使用“识别”函数时,我收到“无效的请求正文”。

                    client.face.identify({
                       faces: arrayFaceId,
                       personGroupId: "groupId",
                       maxNumOfCandidatesReturned: 1,
                       confidenceThreshold: 0.8
                    }).then(function(response){
                       console.log('Response ' + JSON.stringify(response.personId));
                    }, function(error){
                     console.log("Error2"+JSON.stringify(error));
                   });

有人知道我该如何解决吗?

【问题讨论】:

标签: javascript microsoft-cognitive azure-cognitive-services face-api


【解决方案1】:

有问题的 API 采用常规参数,而不是您指定的对象。所以:

client.face.identify(arrayFaceId, "groupId", 1, 0.8)
    .then(function(response) {
        console.log('Response ' + JSON.stringify(response.personId));
    })
    .catch(function(error) {
        console.log("Error " + JSON.stringify(error));
    });

【讨论】:

    猜你喜欢
    • 2018-09-28
    • 2020-08-03
    • 2017-08-04
    • 1970-01-01
    • 1970-01-01
    • 2016-07-07
    • 2017-03-21
    • 2019-06-11
    • 1970-01-01
    相关资源
    最近更新 更多