heidloff.net - Building is my Passion

Thumbs Up for Watson's Visual Recognition Service

Update 06/06/16: Check out this article for new functionality in the Watson Visual Recognition Service.

Watson’s Visual Recognition (beta) service on Bluemix understands the contents of images. Since the beginning of this month you can train this service with your own classifications. Below is a simple sample 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 and not only via web user interfaces and speech recognition. There are many more scenarios where this service could be valuable, for example 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"


Featured Blog Posts
The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.
Trending Tags