Custom Vision Service REST API Using Web Interface To Upload Image And Train

Introduction

This article demonstrates how to easily customize your own state-of-the-art computer vision models that fit perfectly with your unique use case. Just bring a few examples of labeled images and let custom vision do the hard work.  

New cognitive Service Release - Visit for more information - Custom Vision Service
 
Prerequisites

To build a classifier, you must first have,
  •   A vaild Microsoft Account or Azure Active Directory OrgID. Login for AAD user from national cloud is not currently supported.
  •   Custom Vision Login your Microsoft Account (https://customvision.ai/)
  •   A series of images to train your classifier (minimum of 30 image per tag).
  •   A few image to test your classifier after the classifier is trained.
What can Custom Vision Service do well?
 
Custom Vision Service is a tool for building custom image classifier, and for making them better over time. For example, if you want a tool that clouds identify image of "Daisies","Daffodils","Dahlias", you cloud train a classifier to do that. 
 
Getting Started - Build a Classifier
   
Custom Vision Service can be found by clicking here - https://customvision.ai/ 

 
 
 
Click New Project to create your first project.

 
In this check box, then click the I agree button.
 
The New Project dialog box appears.
 
Step 1
 
Enter a name for this project,a description of the project, and select one domin.
 
There are several domains available,and each one optimizes the classifier for a specific type of image: 
 
Domain 
 
Generic, Food, Landmarks, Retail, Adult.
 
Purpose                                 

If none of the other domains are appropriate, or you are unsure of whice domain to choose, Select the Generic domain.
 
You can change the domain later if you wish.
 
Step 2

Next, go to Training Images >> Add images   

 
 
Add some images to train your classifier. Let's say you want a classifier to distinguish between cars and fish. You would upload and tag at least 30 images of cars and fish. 
 
Adding  image procedure
 
Select images   

You can use the REST API to load training images from URLs. The web app can only upload training images from your local computer. 

 
 
Add Tags 

Click "open" to open the selected images. Then Assign tag type in the tag you want to assign, then press the + button to assign the tag. you can add more then one tag at a time to the images.
 
Uploading

When you are done adding tags, click Upload (number) file. The upload could take some time if you have a large number of images or a slow internet connection
 
Summaty

After the files have uploaded, click Done.
 
To load more images with a different set of tag, return to "step2".
 
Step 3
 
Train your classifier
 
After your images are uploaded you are ready to train classifier.

 

It should only take a few minutes to train your first  iteration.

 

Step 4

Evaluate your classifier   

 

The precision and Recall indicator tell you how well your classifier is based on automatic testing. Custom Vision Service uses the images you submitted for training to calculate these numbers, using a process called K-Fold Cross Validation.
 
Precision

When you classify an image, how likely is your classifier to currently classify the image? Out of all images used to train the classifier(cars and fish), what percent  did the model get correct? Tags out of 100 images give a precion of  99 percent.
 
Recall

Out of all images that should have been classified correctly, how many did your classifier identify correctly? A Recall of 100% would mean, if there were  32 car images in the images used to train the classifier, 32 cars were found by the classifier. 
 
Step 5

After that some image are selected and click "Delete" button .

 

Next, go to click train button check your iteration 2 and iteration 3 

 

Finally, we have successfully created  Custom Vision Service Rest API using image upload and training.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now