我在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));
});
谁知道我怎么能解决它?
有问题的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));
});