Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created January 16, 2017 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conanak99/c2bcf0103360fccb3a74c1b8ba0171e7 to your computer and use it in GitHub Desktop.
Save conanak99/c2bcf0103360fccb3a74c1b8ba0171e7 to your computer and use it in GitHub Desktop.
function detect(imageUrl) {
console.log(`Begin to detect face from image: ${imageUrl}`);
let url = `https://api.projectoxford.ai/face/v1.0/detect`;
return rp({
method: 'POST',
uri: url,
headers: {
'Ocp-Apim-Subscription-Key': key
},
body: {
url: imageUrl
},
json: true
});
}
function identify(faceIds) {
console.log(`Begin to identity face.`);
let url = 'https://api.projectoxford.ai/face/v1.0/identify';
return rp({
method: 'POST',
uri: url,
headers: {
'Ocp-Apim-Subscription-Key': key
},
body: {
"personGroupId": 'vav-idols',
"faceIds": faceIds,
"maxNumOfCandidatesReturned": 1,
},
json: true
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment