Skip to content

Roboflow Integration

Roboflow provides a suite of tools designed for building and deploying computer vision models. You can integrate Roboflow at various stages of your development pipeline using their APIs and SDKs, or utilize its end-to-end interface to manage the process from image collection to inference. Roboflow offers functionalities for data labeling, model training, and model deployment, providing components for developing custom computer vision solutions alongside Ultralytics tools.

Licensing

Ultralytics offers two licensing options to accommodate different use cases:

  • AGPL-3.0 License: This OSI-approved open-source license is ideal for students and enthusiasts, promoting open collaboration and knowledge sharing. See the LICENSE file for more details.
  • Enterprise License: Designed for commercial use, this license allows for the seamless integration of Ultralytics software and AI models into commercial products and services. If your scenario involves commercial applications, please reach out via Ultralytics Licensing.

For more details see the Ultralytics Licensing page.

This guide demonstrates how to find, label, and organize data for training a custom Ultralytics YOLO11 model using Roboflow.

Gather Data for Training a Custom YOLO11 Model

Roboflow offers two primary services to assist in data collection for Ultralytics YOLO models: Universe and Collect. For more general information on data collection strategies, refer to our Data Collection and Annotation Guide.

Roboflow Universe

Roboflow Universe is an online repository featuring a large number of vision datasets.

Roboflow Universe

With a Roboflow account, you can export datasets available on Universe. To export a dataset, use the "Download this Dataset" button on the relevant dataset page.

Roboflow Universe dataset export

For compatibility with Ultralytics YOLO11, select "YOLO11" as the export format:

Roboflow Universe dataset export format selection

Universe also features a page aggregating public fine-tuned YOLO models uploaded to Roboflow. This can be useful for exploring pre-trained models for testing or automated data labeling.

Roboflow Collect

If you prefer to gather images yourself, Roboflow Collect is an open-source project enabling automatic image collection via a webcam on edge devices. You can use text or image prompts to specify the data to be collected, helping capture only the necessary images for your vision model.

Upload, Convert and Label Data for YOLO11 Format

Roboflow Annotate is an online tool for labeling images for various computer vision tasks, including object detection, classification, and segmentation.

To label data for an Ultralytics YOLO model (which supports detection, instance segmentation, classification, pose estimation, and OBB), begin by creating a project in Roboflow.

Create a Roboflow project

Next, upload your images and any existing annotations from other tools into Roboflow.

Upload images to Roboflow

After uploading, you'll be directed to the Annotate page. Select the batch of uploaded images and click "Start Annotating" to begin labeling.

Annotation Tools

  • Bounding Box Annotation: Press B or click the box icon. Click and drag to create the bounding box. A pop-up will prompt you to select a class for the annotation.

Annotating an image in Roboflow with bounding boxes

  • Polygon Annotation: Used for instance segmentation. Press P or click the polygon icon. Click points around the object to draw the polygon.

Label Assistant (SAM Integration)

Roboflow integrates a Segment Anything Model (SAM)-based label assistant to potentially speed up annotation.

To use the label assistant, click the cursor icon in the sidebar. SAM will be enabled for your project.

Annotating an image in Roboflow with SAM-powered label assist

Hover over an object, and SAM may suggest an annotation. Click to accept the annotation. You can refine the annotation's specificity by clicking inside or outside the suggested area.

Tagging

You can add tags to images using the Tags panel in the sidebar. Tags can represent attributes like location, camera source, etc. These tags allow you to search for specific images and generate dataset versions containing images with particular tags.

Adding tags to an image in Roboflow

Label Assist (Model-Based)

Models hosted on Roboflow can be used with Label Assist, an automated annotation tool that leverages your trained YOLO11 model to suggest annotations. First, upload your YOLO11 model weights to Roboflow (see instructions below). Then, activate Label Assist by clicking the magic wand icon in the left sidebar and selecting your model.

Choose your model and click "Continue" to enable Label Assist:

Enabling Label Assist in Roboflow

When you open new images for annotation, Label Assist may automatically suggest annotations based on your model's predictions.

Label Assist recommending an annotation based on a trained model

Dataset Management for YOLO11

Roboflow provides several tools for understanding and managing your computer vision datasets.

Use dataset search to find images based on semantic text descriptions (e.g., "find all images containing people") or specific labels/tags. Access this feature by clicking "Dataset" in the sidebar and using the search bar and filters.

For example, searching for images containing people:

Searching for an image in a Roboflow dataset

You can refine searches using tags via the "Tags" selector:

Filtering images by tag in Roboflow

Health Check

Before training, use Roboflow Health Check to gain insights into your dataset and identify potential improvements. Access it via the "Health Check" sidebar link. It provides statistics on image sizes, class balance, annotation heatmaps, and more.

Roboflow Health Check analysis dashboard

Health Check might suggest changes to enhance performance, such as addressing class imbalances identified in the class balance feature. Understanding dataset health is crucial for effective model training.

Pre-process and Augment Data for Model Robustness

To export your data, you need to create a dataset version, which is a snapshot of your dataset at a specific point in time. Click "Versions" in the sidebar, then "Create New Version." Here, you can apply preprocessing steps and data augmentations to potentially enhance model robustness.

Creating a dataset version on Roboflow with preprocessing and augmentation options

For each selected augmentation, a pop-up allows you to fine-tune its parameters such as brightness. Proper augmentation can significantly improve model generalization, a key concept discussed in our model training tips guide.

Export Data in 40+ Formats for Model Training

Once your dataset version is generated, you can export it in various formats suitable for model training. Click the "Export Dataset" button on the version page.

Exporting a dataset from Roboflow

Select the "YOLO11" format for compatibility with Ultralytics training pipelines. You are now ready to train your custom YOLO11 model. Refer to the Ultralytics Train mode documentation for detailed instructions on initiating training with your exported dataset.

Upload Custom YOLO11 Model Weights for Testing and Deployment

Roboflow offers a scalable API for deployed models and SDKs compatible with devices like NVIDIA Jetson, Luxonis OAK, Raspberry Pi, and GPU-based systems. Explore various model deployment options in our guides.

You can deploy YOLO11 models by uploading their weights to Roboflow using a simple Python script.

Create a new Python file and add the following code:

import roboflow  # install with 'pip install roboflow'

# Log in to Roboflow (requires API key)
roboflow.login()

# Initialize Roboflow client
rf = roboflow.Roboflow()

# Define your workspace and project details
WORKSPACE_ID = "your-workspace-id"  # Replace with your actual Workspace ID
PROJECT_ID = "your-project-id"  # Replace with your actual Project ID
VERSION = 1  # Replace with your desired dataset version number
MODEL_PATH = "path/to/your/runs/detect/train/"  # Replace with the path to your YOLO11 training results directory

# Get project and version
project = rf.workspace(WORKSPACE_ID).project(PROJECT_ID)
dataset = project.version(VERSION)

# Upload model weights for deployment
# Ensure model_path points to the directory containing 'best.pt'
project.version(dataset.version).deploy(
    model_type="yolov8", model_path=MODEL_PATH
)  # Note: Use "yolov8" as model_type for YOLO11 compatibility in Roboflow deployment

print(f"Model from {MODEL_PATH} uploaded to Roboflow project {PROJECT_ID}, version {VERSION}.")
print("Deployment may take up to 30 minutes.")

In this code, replace your-workspace-id, your-project-id, the VERSION number, and the MODEL_PATH with the values specific to your Roboflow account, project, and local training results directory. Ensure the MODEL_PATH correctly points to the directory containing your trained best.pt weights file.

When you run the code above, you will be asked to authenticate (usually via an API key). Then, your model will be uploaded, and an API endpoint will be created for your project. This process can take up to 30 minutes to complete.

To test your model and find deployment instructions for supported SDKs, go to the "Deploy" tab in the Roboflow sidebar. At the top of this page, a widget will appear allowing you to test your model using your webcam or by uploading images or videos.

Running inference on an example image using the Roboflow deployment widget

Your uploaded model can also be used as a labeling assistant, suggesting annotations on new images based on its training.

How to Evaluate YOLO11 Models

Roboflow provides features for evaluating model performance. Understanding performance metrics is crucial for model iteration.

After uploading a model, access the model evaluation tool via your model page on the Roboflow dashboard. Click "View Detailed Evaluation."

Initiating a Roboflow model evaluation

This tool displays a confusion matrix illustrating model performance and an interactive vector analysis plot using CLIP embeddings. These features help identify areas for model improvement.

The confusion matrix pop-up:

A confusion matrix displayed in Roboflow

Hover over cells to see values, and click cells to view corresponding images with model predictions and ground truth data.

Click "Vector Analysis" for a scatter plot visualizing image similarity based on CLIP embeddings. Images closer together are semantically similar. Dots represent images, colored from white (good performance) to red (poor performance).

A vector analysis plot in Roboflow using CLIP embeddings

Vector Analysis helps:

  • Identify image clusters.
  • Pinpoint clusters where the model performs poorly.
  • Understand commonalities among images causing poor performance.

Learning Resources

Explore these resources to learn more about using Roboflow with Ultralytics YOLO11:

Project Showcase

Feedback from users combining Ultralytics YOLO11 and Roboflow:

Showcase image 1 Showcase image 2 Showcase image 3

FAQ

Frequently Asked Questions

How do I label data for YOLO11 models using Roboflow?

Use Roboflow Annotate. Create a project, upload images, and use the annotation tools (B for bounding boxes, P for polygons) or the SAM-based label assistant for faster labeling. Detailed steps are available in the Upload, Convert and Label Data section.

What services does Roboflow offer for collecting YOLO11 training data?

Roboflow provides Universe (access to numerous datasets) and Collect (automated image gathering via webcam). These can help acquire the necessary training data for your YOLO11 model, complementing strategies outlined in our Data Collection Guide.

How can I manage and analyze my YOLO11 dataset using Roboflow?

Utilize Roboflow's dataset search, tagging, and Health Check features. Search finds images by text or tags, while Health Check analyzes dataset quality (class balance, image sizes, etc.) to guide improvements before training. See the Dataset Management section for details.

How do I export my YOLO11 dataset from Roboflow?

Create a dataset version in Roboflow, apply desired preprocessing and augmentations, then click "Export Dataset" and select the YOLO11 format. The process is outlined in the Export Data section. This prepares your data for use with Ultralytics training pipelines.

How can I integrate and deploy YOLO11 models with Roboflow?

Upload your trained YOLO11 weights to Roboflow using the provided Python script. This creates a deployable API endpoint. Refer to the Upload Custom Weights section for the script and instructions. Explore further deployment options in our documentation.

📅 Created 1 year ago ✏️ Updated 1 day ago

Comments