方法identify()中的Microsoft Face API错误

问题描述 投票:0回答:1

我在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个回答
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));
    });
© www.soinside.com 2019 - 2024. All rights reserved.