2017-04-24 71 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