2017-04-24 34 views
0

我在JavaScript中使用Microsoft Face API项目,当我使用函数“identify”时,我收到“Invalid request body”。Microsoft Face API在JavaScript中识别错误

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

任何人都知道我可以修复它吗?

+0

您能在问题中包含指向文档的链接吗? – guest271314

+0

https://github.com/felixrieseberg/project-oxford#Client.face..detect – girlcoding

+0

你可以在问题中包含'arrayFaceId'吗? – guest271314

回答

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

谢谢,它的工作原理 – girlcoding