node-oxford-emotion
v1.0.4
Published
Small library that incorporates Microsoft's project Oxford Emotion Recognition
Downloads
4
Readme
Node JS - Oxford Emotion
Small library that incorporates Microsoft's project Oxford Emotion Recognition
Installation
npm install node-oxford-emotion --save
Usage
URL:
var oxfordEemotion = require("node-oxford-emotion")(api-key)
var emotion = oxfordEmotion.recognize("url", image-url, function(cb) {
console.log(cb);
});
Local Image:
var oxfordEemotion = require("node-oxford-emotion")(api-key)
var emotion = oxfordEmotion.recognize("image", imageData, function(cb) {
console.log(cb);
});
You need to read the file as binary data. You can use this function:
function binaryRead(file) {
var bitmap = fs.readFileSync(file);
return new Buffer(bitmap.toString('binary'),'binary');
}
You also need to parse the response using JSON.parse() if you input binary file.
TODOS
Nothing.
Project Oxford Documentation
Release History
- 1.0.0 Initial Release
- 1.0.1 Add callback
- 1.0.2 Add support for local images
- 1.0.4 Fix typo in README