Object detection is a common and important computer vision task that involves identifying and labeling objects within images, video frames, or live feeds. It involves labeling each instance of a specific object within an image. An object detection model will draw bounding boxes around objects, learning to identify and predict future instances as it processes more visual data over time.
Collect the data for your model
First, create a new dataset. Click on the "Create New" on the side navigation and select Dataset. Enter a name for your dataset. Click "Save & Continue to Sources".
Next, you will need to add your datasources to your dataset. In the "Sources" tab, you have several options including uploading files from your local machine or connecting to a Google Cloud or Amazon S3 storage bucket to sync your images.
In this example, we are using a dataset from a Google Cloud storage bucket and synced to Plainsight.
Define your Object Detection label
Once you are happy with the images you have added for your dataset, you can define your bounding box label which is used for object detection.
In the "Label Definitions" tab, enter a name for the label. In this example we named our label truck. Next, select the Bounding Box label type. Optionally, you can select a color for the label using the color chooser, or keep the default.
If this is a new dataset, scroll down and click "Save and Start Labeling" to begin labeling your data.
Label your training data
You are now ready to label the images using the bounding box label type you defined in the previous step. In the "Labeler", select the bounding box label from Labels panel.
Repeat this process for all the images in your dataset. You also have the option to "Skip" over any images you wish to exclude from labeling.
Review and approve
Use the "Review" tab to review your dataset and approve the images to you wish to train your model with. (You can also go directly to the Versions tab and approve all Submitted images when you lock a new version.)
Before you can train or export a dataset, you must lock your dataset version. Click on the Versions tab to create a new version. You must have at least 3 annotated images in your dataset to complete this step.
Train your model
After locking a dataset version, you can click "Train" on the dataset version to configure your training options.
Train a model from a dataset version.
You will be taken to the "Add New Model" screen. Enter a model name and select your desired training options. Under the "Model Output Options" drop-down, select "Bounding Box".
Configure model training options with SmartML.
Once you are satisfied with your training settings, scroll down and click "Save & Start Training" to begin training your model. Your model will enter several training states as it goes through the training process.
Your model can take up to the budgeted Training Time (or slightly over) to train. You will be notified by email and an in-app notification when your model is ready.
An email and in-app notification will notify you that your model is ready.
Below shows the model version details of a successfully trained model.
Successfully trained object detection model.
You can scroll down and view the dataset images and preview your model's performance.
Preview images in the dataset splits and compare model detections and labeled annotations.
Predict values with the Predictions API
If you wish to deploy your model and gather predictions, you can click "Start Image API" to initialize an endpoint for the Predictions API.
Start the Image API to deploy the model.
Deploying the model can take up to 20 mins. The "Image API" status will show as "Active" when it's ready to use.
Once your API is in the "Active" state, the endpoint is ready to use. You can then copy the "Image API URL" endpoint and use it to send an image and return predicted classes.
Copy the Image API URL to make Prediction requests and return detections.
You will need to generate a valid API Key to make a request. This key is used as an access token. See curl example below to see how the endpoint, API Key, and input image for is used in a Predictions API request.
curl -X POST 'https://<HOSTNAME>/v1/models/01ERDH3S3TZ34S863N47RWECA7/predict'\