我在JavaScript中使用Microsoft Face API项目oxford,当我使用“ identify”功能时,收到“ Invalid request body”。

                    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));
                   });


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

最佳答案

有问题的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));
    });

10-06 07:23
查看更多