IBM Watson visual recognition service on Bluemix always returns empty content

I am trying to test the IBM Watson visual recognition service on Bluemix using the API tester.

1st I want to get a list of valid labels:

While reading the source code of the demo application, I was outputting labels eg. "Animal"

Any idea what I am doing wrong?

The demo app seems to work well enough, at least it recognizes Obama's image as "man, president, Obama" :)

+3


source to share


1 answer


Check out the links below for some examples of using this service.

If you were using the image http://visual-recognition-demo.mybluemix.net/images/63992.jpg . A post request to Watson will look like this.

form data for watson

All server side code (Node.Js) streams 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);
            }
        });
    }

      

A demo to upload your own image and identify it

The code for the above application is available here .

+4


source







All Articles