Analyze an image by sending it to the Computer Vision API
Microsoft Azure Cognitive Services contain some pre-built models for the most typical tasks, such as object detection in pictures, speech recognition and synthesis, sentiment analysis and so on. Let us test the Computer Vision API service to see if it can recognize some specific objects in one particular problem domain.
Suppose we need to create an application that recognizes Simpson Lego Figures:
The Computer Vision Endpoint must be created inside a resource group. You can use an existing resource group or create a new one. To create a new resource group, use the following command. Replace <<resource-group-name>> with your name to use for this resource group. Replace <<location>> with the Azure region to use for this resource group.
az group create --name <resource-group-name> --location <location>
Create the Cognitive Service Account
Run the command below to create a free Computer Vision Endpoint. Replace <<resource-group-name>> with the name you used above and use the same location. Replace <<name>> with a name for your resource like: my-computervision.
The response should look like:
"tags":[ "text", "indoor", "toy" ],
"text": "a hand holding a toy",
Using a web interface
Navigate to: https://cgntv-cv.azurewebsites.net/
Enter the endpoint URL, the API key, a link to an image and click 'analyze image'. This website shows all the information that comes back from the Computer Vision API.
Tip: Try it with your own images!
In this lab you have created a Computer Vision Endpoint in Azure and send images to the endpoint using the command line and a through a visual interface.
While some of the objects (such as Toy) can be recognized by the pre-trained model, more specialized objects (like this is Bart Simpson or Marge Simpson) are not determined correctly.