Azure Custom Vision is a powerful tool for building custom AI models that can recognize and classify images. It's a great way to get started with AI development.
To begin, you'll need to create a new project in the Azure portal. This involves selecting the Custom Vision service and choosing a resource group.
Azure Custom Vision offers a free tier that includes 100 images and 100 predictions per month. This makes it an excellent choice for small projects or testing purposes.
You can also upload your own images to train your model, or use the pre-built models provided by Azure Custom Vision.
Getting Started Guide
To get started with Azure Custom Vision, you'll need a Microsoft account linked to an Azure subscription.
First, head over to the Custom Vision website at https://customvision.ai/ and click on Sign-In. You'll then be able to create a new project.
Fill in the Name and Description for your project, and for the Resource, you may need to press 'create new' and fill in additional information. Make sure the Project type is set to 'Object Detection' since we're detecting objects for this demonstration.
The Domains option can be left as General, but I recommend setting it to General (compact) as this gives you the ability to export your model at a later stage.
Custom Vision is an image recognition service that lets you build and deploy your own image identification model. You can upload your own images and tag them with labels depending on the outcome you wish to see.
Custom Vision can be used for various tasks such as:
- Applying labels and classifying images based upon those labels
- Detecting objects within an image and outputting their coordinates
By following these steps, you'll be able to set up a new project and start using Custom Vision for your object detection needs.
Labeling and Training
You can label a computer vision dataset in Azure Custom Vision by following a few simple steps. Once your Custom Vision instance has deployed, you're ready to start using Custom Vision.
To label an image, you can either draw bounding boxes around objects of interest manually or use automated labeling, which attempts to label an object of interest using a trained model. To use automated labeling, you must have a trained model on Azure Custom Vision.
There are two methods of labeling: manual labeling, where you draw bounding boxes with your cursor, and automated labeling, which uses a trained model to label an object of interest. To label objects automatically, first train a version of your model, then a “Suggested objects on” toggle will appear on images in the Custom Vision labeling tool.
To improve the accuracy and quality of your model, you need to provide it with a good variety of data. This includes images with different lighting conditions, environments, and angles.
To improve your model, you can add more good quality data and re-train. The last navigation menu option “Predictions” on Custom Vision shows you the images you have uploaded to test your model for a given iteration.
Create a Project
To create a project in Custom Vision, first sign in to the website at https://customvision.ai/ using your Microsoft account linked to an Azure subscription. This will bring you to the main interface where you can start creating a new project.
You can then click on the "Create Project" button, which will prompt you to provide a name for your project. Choose a name that accurately represents the object detection model you're trying to create.
Next, you'll need to choose an instance of Custom Vision with which your project should be associated. This is the resource you created in the previous step.
For this guide, we'll train an object detection model, so make sure to choose "Object Detection" as your project type. You can also leave the Domains option as "General" for now, but it's recommended to set it to "General (compact)" to enable exporting your model later.
Here's a quick summary of the steps:
- Sign in to the Custom Vision website with your Microsoft account linked to an Azure subscription.
- Click on the "Create Project" button.
- Provide a name for your project.
- Choose an instance of Custom Vision to associate with your project.
- Choose "Object Detection" as your project type.
- Set the Domains option to "General (compact)" for easier model export later.
By following these steps, you'll be able to create a new project in Custom Vision and start training your object detection model.
Label an Image
Labeling an image is a crucial step in training a computer vision model. You can label an image manually or automatically, depending on your needs.
To label an image manually, click on a point at the edge of an object of interest and drag to draw a bounding box. This method is useful when you need to label specific objects in an image.
There are two methods of labeling in Azure Custom Vision: manual labeling and automated labeling. Manual labeling involves drawing bounding boxes around objects of interest, while automated labeling uses a trained model to label an image.
To use automated labeling, you must have a trained model on Azure Custom Vision. The "Suggested objects on" toggle will appear on images in the Custom Vision labeling tool, allowing you to use your model to label an image.
Roboflow Annotate is a faster way to annotate images. It provides label assistant features to speed up the annotation process. You can also use model-assisted labeling with models hosted on Roboflow Universe to automatically recommend annotations while labeling images.
Here are the steps to label an image:
- Manual labeling: click on a point at the edge of an object of interest and drag to draw a bounding box.
- Automated labeling: toggle the "Suggested objects on" option and use your trained model to label the image.
Labeling images is an iterative process. You'll need to continue labeling all the images in your dataset, then train a model using Azure Custom Vision.
Model Creation and Deployment
Creating a custom computer vision model in minutes is possible with Azure Custom Vision, part of Azure AI Services. You can customize and embed state-of-the-art computer vision image analysis for specific domains without requiring machine learning expertise.
To build your image identifier model, you can easily use the simple interface of Azure Custom Vision. This intuitive model creation process allows you to focus on your project's goals rather than getting bogged down in complex technical details.
You can deploy your model anywhere, from the cloud to the edge, using containers. This flexibility is made possible by Azure Custom Vision's ability to run in the cloud or on the edge in containers, as mentioned in Example 5 and Example 6.
Here's a step-by-step guide to deploying your model using Docker:
- Make sure Docker is running and it's in your PATH Environment Variable.
- Export your own model docker image from Custom Vision or use the provided demo model and put it into the \Docker directory.
- Either drag and drop the .zip package onto the DragNDropRunWindows.bat or open a PowerShell window in the \Docker directory and type: ExtractBuildRun.ps1 1514101266af4aca92dcfdee24bec30f.DockerFile.Linux.zip
- After it builds and runs it will display * Running on http://172.17.0.2:80/ (Press CTRL+C to quit).
Create an Instance
To create an instance, you'll need to go to the Azure dashboard and search for "Custom Vision" in the search bar.
Click the "Create custom vision" button to start the process. This will take you to the Custom Vision homepage where you can create a new instance.
You'll be asked to select whether you want to train, deploy, or both train and deploy with Custom Vision. Choose the option relevant to your project.
To create a Custom Vision instance, you'll need to attach it to a resource group, select a project name, and choose the pricing tier for your instance.
Create a Model in Minutes
Custom Vision, part of Azure AI Services, allows you to create a custom computer vision model in minutes. No machine learning expertise is required.
You can customize and embed state-of-the-art computer vision image analysis for specific domains with AI Custom Vision. This can help build frictionless customer experiences, optimize manufacturing processes, and accelerate digital marketing campaigns.
Using the simple interface, you can easily build your image identifier model. This intuitive model creation process makes it accessible to users without extensive machine learning knowledge.
To get started, you'll need to train a machine on some input data, such as images. You'll specify where in each image there is a license plate, referred to as ‘tagging’ or ‘labelling’. This process involves including a variety of different lighting conditions, environments, and angles.
Here are some key metrics to consider when evaluating your model's performance:
You can fine tune your model's behavior using the "Probability Threshold" and "Overlap Threshold" sliders on the Performance Tab.
Flexible Deployment
You can run AI Custom Vision in the cloud or on the edge in containers. This flexibility is a game-changer for developers who need to deploy their models quickly and efficiently.
The ability to deploy anywhere, from the cloud to the edge, is made possible by the fact that you can easily export your trained models to devices or to containers for low-latency scenarios. This means you can choose the deployment method that best suits your needs.
To deploy your model on the edge, you can use Docker and a simple PowerShell script. The script will unpack, build, and deploy the service in your local environment. You'll need to have Docker installed along with the WSL 2 backend.
Here are the steps to follow:
- Make sure Docker is running and it’s in your PATH Environment Variable.
- Export your own model docker image from Custom Vision or use the provided demo model and put it into the \Docker directory.
- Either drag and drop the .zip package onto the DragNDropRunWindows.bat or open a PowerShell window in the \Docker directory and type: ExtractBuildRun.ps1 1514101266af4aca92dcfdee24bec30f.DockerFile.Linux.zip where 1514101266af4aca92dcfdee24bec30f.DockerFile.Linux.zip is the name of the model package file.
- After it builds and runs it will display * Running on http://172.17.0.2:80/ (Press CTRL+C to quit). This will be the internal address the server is running at, it can be accessed locally at http://127.0.0.1/image
- To terminate the service in the console window press CTRL+C
You can also export your trained model to a Docker container image, which can be easily deployed on any device. To do this, go to the Performance tab on Custom Vision and hit the Export button on the iteration you desire.
Running Predictions
Running predictions is a crucial step in the model creation and deployment process. You can use the model created from the first part to run predictions on new unseen data.
The model can be run on new images of cars with license plates visible in them. These images will not be tagged, but rather observed to see if there are accurate predictions after they have been run through the service.
The output of the prediction will be made up of the model created from the first part of the process. This model will use the tagged images to make predictions on the new unseen data.
You can deploy the model anywhere, from the cloud to the edge, depending on your unique scenario and requirements. This flexibility allows you to run your models wherever you need them.
Frequently Asked Questions
What is the difference between custom vision and computer vision?
Custom Vision is limited to image classification and object detection, but allows you to train models with your own images. Computer Vision APIs offer more capabilities, but models are pre-trained and not customizable.
What is the vision of Microsoft Azure?
Azure AI Vision is a unified service that offers innovative computer vision capabilities, enabling apps to analyze images and detect faces with prebuilt features. It's part of Microsoft Azure, a cloud platform that empowers developers to build intelligent solutions.
Sources
- https://blog.roboflow.com/how-to-label-azure-custom-vision/
- https://azure.microsoft.com/en-ca/products/ai-services/ai-custom-vision
- https://www.spheregen.com/exploring-azure-custom-vision-for-image-recognition/
- https://www.cloudthat.com/resources/blog/azure-custom-vision-for-custom-image-recognition
- https://mantelgroup.com.au/how-to-build-an-ai-object-detection-system-with-azure-custom-vision/
Featured Images: pexels.com