Last active
December 17, 2015 18:18
-
-
Save germanattanasio/e32094c48e5ac837d848 to your computer and use it in GitHub Desktop.
Example of how to call the AlchemyVision with the watson-developer-cloud npm module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// face recognition with a URL | |
var params = { | |
knowledgeGraph: 1 // Include knowledge graph information in the the results. | |
url: 'https://upload.wikimedia.org/wikipedia/commons/0/00/Scarlett_Johansson_-_Captain_America_2_press_conference_%28retouched%29_2.jpg' | |
}; | |
// UNCOMMENT THE CODE BELOW TO SEND AN IMAGE INSTEAD OF A URL | |
// face recognition with an image | |
// var params = { | |
// image: fs.createReadStream('resources/face.jpg') | |
// }; | |
// UNCOMMENT THE CODE BELOW TO SEND AN IMAGE AS BASE64 ENCODED IMAGE | |
// face recognition with an image | |
// var params = { | |
// image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYQAAAImCAYAAABTgf2rAAA....' | |
// }; | |
alchemy_vision.recognizeFaces(params, function (err, keywords) { | |
if (err) | |
console.log('error:', err); | |
else | |
console.log(JSON.stringify(keywords, null, 2)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment