I'm trying to test the IBM Watson Visual Recognition Service in Bluemix using the API tester.
1st I want to get the list of valid labels:
While reading the source code of the demo app I was inferring the labels, e.g. "Animal"
Any idea what I'm doing wrong?
The demo app seems to work quite well, at least it recognizes an image of Obama as "person, president, obama" :)
Check out the following links for some examples on how to use the service.
If you were to use the image http://visual-recognition-demo.mybluemix.net/images/63992.jpg. The post request to Watson would look like the following.
All the code on the server side (Node.Js) is doing is streaming the image to Watson.
function(req, res) {
var stream = fs.createReadStream(req.files.imgFile.path);
var params = {
image_file: stream
};
visualRecognition.recognize(params, function(error, result) {
if (error) {
return res.status(error.error ? error.error.code || 500 : 500).json({ error: error });
} else {
return res.json(result);
}
});
}
Demo allowing you to upload your own image and identify it
The code for the above app is available here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With