Skip to content
Jeff Arn edited this page Nov 9, 2016 · 4 revisions

Deploying the Starter Application to Bluemix

In this section, you will get familiar with the Visual Recognition service using a pre-built application that IBM has provided.

Before you get started, you will need an active account on Bluemix. You can register for an account here - https://console.ng.bluemix.net/registration/

  1. In the README.md file in the Visual Recognition application repo, you will find a "Deploy to Bluemix" button near the top. This button will take the existing Visual Recognition application, and deploy a unique copy of it to your Bluemix account. During this process, a new instance of the Visual Recognition service will be created.
  2. Once you are on the application deployment page, you will be able to name your application. The name of your application will be used in the final URL for the app following the convention .mybluemix.net.
  3. Still on the application deployment page, you can leave the REGION, ORGANIZATION, and SPACE values at their defaults, and then select DEPLOY

With this, you application will begin deploying to Bluemix, and once deployed you'll be ready to move on to the next step.

Classifying Images in the Starter Application

Once the application is deployed, you can select the VIEW MY APP button to open the starter application.

The application is composed of two sections, a "Try" section and a "Train" section. The Try section will allow you to send an individual image to the Visual Recognition service to be classified.

Test out the existing service by selecting one of the provided images or pasting a URL for an image of your choice. You will see the service respond with a collection of recognized attributes about the image.

Next, try running the following image through the classifier by pasting the URL into the "Try" panel.

https://github.com/watson-developer-cloud/doc-tutorial-downloads/raw/master/visual-recognition/fruitbowl.jpg

You'll see that it's recognized some general attributes about the image, but we want it to be able to specifically recognize it as a "fruitbowl". To do that, we will need to train a customer classifier.

Training a Custom Classifier in the Starter App

Navigate over to the "Train" window in the application.

Here, you will see a collection of training sets that have been provided for you. If you select any one of these, you will see that set expand to show a series of classes that will be trained, as well as negative examples of that group. For example, the Dog Breeds classifier contains 4 classes of dogs to be identified, as well as a negative example data set of Non-dogs.

To train the service to specifically classify a fruitbowl, we are going to use two collections of images to teach Watson what to recognize when classifying a fruitbowl. Click on the "Use your Own" box, and afterward a series of boxes will appear to allow you to upload .zip files for the classes.

Download and select the following .zip files for the classifier:

Positive Class #1 (leftmost box) - watson-labs.mybluemix.net/data/fruitbowl.zip

Negative Class (rightmost box) - watson-labs.mybluemix.net/data/not-fruit-bowls.zip

Once the two zip files are included, name the classifier "fruitbowl" and select the "Train your classifier" button

The classifier may take a couple minutes to train, and once it is complete the application will update to allow you to submit new images against that classifier. If you submit the original image that we used in the new prompt on the "Train" window, you will see that it will be specifically classified based on our new training!

What do I do now?

While this was a very simple example of how the Visual Recognition service works, you may also be interested in bringing these functions into an existing code base. For an example of how to use some of this same functionality in the terminal, navigate to the CLI section in this wiki.

Thanks for trying out the Visual Recognition lab!

Clone this wiki locally