How to train models
Learn how to use Supervisely Apps to train custom AI models, deploy them on your GPU and use in the labeling toolboxes
This 5-minute tutorial is a part of introduction to Supervisely series. You can complete them one-by-one, in random order, or jump to the rest of the documentation at any moment.
How to train models (you are here)
To learn more about training a model on your custom data and pre-labeling (getting predictions from) your images with the trained models, watch this video tutorial.
We will provide a step-by-step guide for training a custom model, using YOLO (v8, v9) as an example. Supervisely offers a no-code solution for training, deploying and predicting with YOLO (v8, v9) models directly in your web browser, leveraging user-friendly interfaces and integrated tools.
Step 1. Prepare training data
You have several options for preparing your training data:
We recommend starting experiments with several hundred images. Continuously improve your object detection neural network by adding new images, especially those where the model's accuracy is lower.
Import your existing training dataset (such as COCO and YOLOv5) and try to build neural network model directly on your custom data.
Pick ready-to-use data we prepared for you and reproduce this tutorial from start to end.
Step 2. Deploy an agent
Before you start training or running neural networks, you need to connect your PC or a cloud server with a GPU to Supervisely by running a simple command in your terminal. This connection allows you to train neural networks and run inference directly from the Supervisely web interface. You can find detailed instructions on how to do this here.
Ensure no network configuration is needed, and the connection is secure and private.
Step 3. Train a model
Open the training app from your labeled data project, click the
[⫶]
button → Neural Networks → YOLO → Train YOLO (v8, v9).
Follow the wizard to configure the main training settings, similar to those allowed by the original repository. You can:
Choose all or a subset of classes for training.
Define training and validation splits.
Select one of the available model architectures.
Configure training hyperparameters, including augmentations.
Press the
Train
button and monitor logs, charts and visualizations in real-time.
The training process generates artifacts, including model weights (checkpoints), logs, charts, additional visualizations of training batches, predictions on validation data, precision-recall curves, confusion matrices and so on. These artifacts will be automatically saved to your Team Files.
Step 4. Deploy a trained model
Once the model is trained, you probably want to try it on your data and evaluate its performance.
Use the Serve YOLO (v8, v9) app to deploy your model as a REST API service so it can receive images and return predictions in response.
Provide the checkpoint (model weights file in
.pt
format) and follow the app's instructions.
In Supervisely you can quickly deploy custom or pretrained neural network models weights on your GPU using the Serve Supervisely Applications in just a few clicks.
Step 5. Get predictions
Option 1. Integrate model in Labeling Interface
Use the NN Image Labeling app to apply your model to images or regions of interest during annotation, configure inference settings like confidence thresholds or select all or several model classes.
This approach gives you the ability to automatically pre-label images and then just manually correct model mistakes
Option 2. Apply model to all images at once
Use the Apply NN to Images Project app to pre-label all images in a project. Follow the wizard to configure settings and run batch inference (connect to the model, select model classes, configure inference settings, and preview predictions).
The app will iterate over all images in your project, apply your model in a batch manner, and save all predicted labels to a new project.
Step 6. Export weights
The trained model can be easily exported and used outside the platform. Go to the directory with training artifacts in your Team Files and download the model weights in PyTorch (.pt
) format for external use.
Now you can follow the YOLOv8 documentation to get predictions on images.
Here is a Python example of inference:
You can check the main section of the documentation on neural networks:
Starting with Neural NetworksLast updated