From state-wide droughts to seafood fraud, the Watson Visual Recognition API service has been busy tackling complex challenges around the world. Yet, the service itself is incredibly simple to use, so much so that even non-programmers can fully train Watson to recognize highly unique objects without writing a single line of code.
Today, we’ll go through 4 easy steps to create your very own custom classifier.
1. Create a Bluemix account
Action: Visit bluemix.net and click “Create a free account”
Bluemix is IBM’s cloud platform which offers a catalog of over 150 services, including all of the Watson APIs. To get started, simply follow the sign-up steps on the Bluemix website.
2. Get a Watson Visual Recognition API key
Action: Visit the Watson Visual Recognition Bluemix service page and click “Create”
To use the service, you’ll first need an API key. Visit the Watson Visual Recognition service page from within the catalog and provision your key by clicking on the “Create” button at the bottom. For this exercise, we’ll leave the entry fields in their default state.
Once created, you can find your API key by going to your Bluemix dashboard, clicking on the Watson Visual Recognition service, selecting “Service credentials” in the left-hand column, and then clicking on “View credentials.” Your API key will be in quotations after the “api_key” field in the JSON snippet that appears. Keep this handy as you’ll need it in the next step!
3. Create your classifier through the tooling
Action: Enter the Watson Visual Recognition tool with your API key, then click “Create classifier” to upload your images.
The Watson Visual Recognition tool allows anyone to directly interact with the API service through a web browser. This means you can use the general tagging, face detection, and custom classifier features without writing a single line of code. Better yet, everything is synced to your API key, so if you create a custom classifier through the tooling and later decide to make changes via command line, your earlier work will be available for editing.
To get started, grab your API key as detailed in the previous step (it should be a long string of numbers and letters) and enter it into the Watson Visual Recognition tool homepage.
Once you’ve logged in, click the “Create classifier” button at the top left. You’ll be brought to a page where you can upload training images to teach the service to recognize custom content. In this demo, we’ll teach Watson to tell the difference between apples and pears, and you can follow along using some data we’ve prepared for you here. Simply upload the 2 zip files contained in that folder (1 per class) and sit tight as the service is trained.
4. Classify any new image
Action: Submit images to your trained classifier through the Watson Visual Recognition tool.
Once your classifier is done training, it’ll show up in your tooling dashboard with with a green “ready” indicator underneath the name. You can now submit images to the classifier to see it in action!