Introducing command line tools for Watson Visual Recognition

The Watson Visual Recognition service is a powerful tool that enables you to leverage cognitive computer vision to extract information from any image library. You can even go beyond standard object classification and use what are called ‘custom classifiers’ to train the Watson service to recognize specific items or conditions of your choosing. For example, you can train Watson to classify breeds of animals, identify rust on metal objects, detect cracks in a pipe, interpret satellite imagery, and much, much more.

Using the command line interface, you no longer need to figure out how to post your files for training or classification using CURL or some other HTTP client utility. Instead, you can simply invoke a command and point it to the files that you want to train or test, and it just works. This is incredibly helpful if you are performing iterative development and testing of custom classifiers, enabling you to create, test, and remove custom classifiers with ease.

To install the Watson Visual Recognition command line utility (CLI), first make sure you have Node.js installed, then open up a terminal and run:

npm install -g watson-visual-recognition-utils

Once you have the CLI installed, you’ll be able to use one-step commands to interact with the visual recognition service. Note: You must have a valid Visual Recognition key to use this tool. If you do not have one, you can get a free trial here.

Usage:

Run either the command watson-visual-recognition-utils or wvru in the terminal (both are aliases to the same code), you should see something like this:

Classify (invoke a classifier)

To classify an image using using the CLI, you should invoke the classifier-classify command and pass parameters to identify the path to the image and the classifier ids that should be used as a comma delimited list. You can also specify default to use the default Watson classifier:

What Next?

Ready to get started? First you need to make sure you have an API key to start using the Watson Visual Recognition service. Next, install the command line interface using Node.js/npm. Then you’re ready to start creating and testing your own custom classifiers. Be sure to check the Watson Visual Recognition documentation for any service related questions. You can also submit bugs or feature request, or even contribute to the project source code over on Github.