Over a million developers have joined DZone.

Thumbs Up for Watson's Visual Recognition Service

DZone 's Guide to

Thumbs Up for Watson's Visual Recognition Service

How to use Watson's visual recognition service to enhance your IoT apps on IBM's Bluemix platform.

· IoT Zone ·
Free Resource

Watson’s Visual Recognition (beta) service on Bluemix understands the contents of images. Since the beginning of the month you can train this service with your own classifications. Below is a simple sample showing how to train Watson to recognize the thumbs up gesture.

This functionality could be used for example in the selfie drone scenario to steer drones using gestures instead of web user interfaces or speech recognition. There are many more scenarios where this service could be valuable, such as damage recognition of buildings and vehicles, tourist guides or tagging of photos.

In order to train the service you need to provide at least 50 images which are positive examples and 50 images which are negative examples. You can try the service online and use predefined sets of images or upload your own images, in my case 100 images with hands.


After 4-5 minutes the Watson service has been trained and you can upload other images to test the new classifier. I used this picture:


Watson returned a confidence score of 85%.


In order to use this functionality in your apps you need to create your own service instance on Bluemix to get your own credentials. To create classifiers you can use REST APIs, Java or Node.js APIs or simply curl commands. The positive and negative sample pictures need to be put in zip files.

curl -u "{username}":"{password}" -X POST -F "positive_examples=@up.zip" -F "negative_examples=@not.zip" -F "name=thumbup" "https://gateway.watsonplatform.net/visual-recognition-beta/api/v2/classifiers?version=2015-12-02"


In order to request classifications of an image you need to provide a JSON file “classifierlist.json” with the classifier IDs.

    "classifier_ids": [

After this you can invoke this command.

curl -u "{username}":"{password}" -X POST -F "images_file=@thumbs3.JPG" -F "classifier_ids=<classifierlist.json" "https://gateway.watsonplatform.net/visual-recognition-beta/api/v2/classify?version=2015-12-02"


"classifier_ids": [
ibm watson ,bluemix ,recognition

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}