> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cvat-ai/cvat/llms.txt
> Use this file to discover all available pages before exploring further.

# Roboflow Integration

> Use Roboflow Universe models for automatic annotation in CVAT

## Overview

The Roboflow integration allows CVAT users to leverage over 50,000 pre-trained computer vision models from Roboflow Universe directly within CVAT. This integration enables rapid automatic annotation, significantly reducing manual labeling time.

<Note>
  The Roboflow integration is available for CVAT Cloud users and Enterprise self-hosted installations. It is not available for community self-hosted deployments.
</Note>

## What is Roboflow?

[Roboflow](https://roboflow.com/) is a comprehensive platform for computer vision development that provides:

* **Roboflow Universe**: A repository of 50,000+ pre-trained models
* **Model training and deployment**: Tools for training custom models
* **Dataset management**: Features for organizing and versioning datasets
* **Data augmentation**: Automated image preprocessing and augmentation

## Prerequisites

* CVAT Cloud account or Enterprise self-hosted installation
* Roboflow account (free or paid)
* A CVAT task or project with labels defined

## Adding a Roboflow Model

Follow these steps to add a Roboflow model to CVAT:

### Step 1: Find a Model on Roboflow Universe

1. Visit [Roboflow Universe](https://universe.roboflow.com/)
2. Search for a model that matches your annotation needs
3. Note the model's supported labels and architecture
4. Copy the model's API information

### Step 2: Add the Model in CVAT

1. In CVAT, navigate to the **Models** page
2. Click **Add model**
3. Select **Roboflow** as the model source
4. Enter the following information:
   * **Model name**: A descriptive name for your model
   * **API endpoint**: Your Roboflow model endpoint
   * **API key**: Your Roboflow API key
5. Click **Add** to save the model

<Tip>
  You can find your Roboflow API key in your [Roboflow account settings](https://app.roboflow.com/settings/api).
</Tip>

## Using Roboflow Models for Automatic Annotation

Once you've added a Roboflow model, you can use it for automatic annotation:

### Step 1: Start Automatic Annotation

1. Open the task you want to annotate
2. Click **Actions** > **Automatic annotation**
3. Select your Roboflow model from the dropdown

### Step 2: Match Labels

Map the model's output labels to your task labels:

1. CVAT will display the model's available labels
2. For each model label, select the corresponding label in your task
3. Unmatched labels will not be annotated

<Warning>
  Ensure your task labels match the model's output labels. If the model was trained on different labels, you may need to adjust your task's label schema or choose a different model.
</Warning>

### Step 3: Configure Options

* **Threshold**: Set the confidence threshold (0.0-1.0). Lower values include more predictions but may reduce accuracy
* **Clean old annotations**: Toggle to remove existing annotations before running the model
* **Return masks as polygons**: Convert segmentation masks to polygon shapes

### Step 4: Run Annotation

Click **Annotate** to start the automatic annotation process. CVAT will:

1. Send your images to the Roboflow API
2. Receive predictions from the model
3. Create annotations in your task
4. Display progress in the interface

You can cancel the process at any time by clicking **Cancel**.

## Example Workflow

Here's a complete workflow using a Roboflow model:

```python theme={null}
# Using the CVAT Python SDK with Roboflow models
from cvat_sdk import make_client

client = make_client(host="https://app.cvat.ai", credentials=("username", "password"))

# Get the task
task = client.tasks.retrieve(task_id)

# Run automatic annotation with a Roboflow model
task.annotate(
    model_name="roboflow-vehicle-detection",
    mapping={
        "car": "vehicle",
        "truck": "vehicle",
        "bus": "vehicle"
    },
    threshold=0.5,
    clear_existing=False
)
```

## Supported Model Types

The Roboflow integration supports the following model types:

* **Object Detection**: Bounding boxes for detected objects
* **Instance Segmentation**: Pixel-level masks for objects
* **Semantic Segmentation**: Pixel classification across the entire image
* **Classification**: Image-level labels
* **Keypoint Detection**: Skeletal keypoints for pose estimation

## Best Practices

<AccordionGroup>
  <Accordion title="Choose the Right Model">
    * Select models trained on similar data to your use case
    * Check the model's performance metrics on Roboflow Universe
    * Test multiple models to find the best fit for your data
  </Accordion>

  <Accordion title="Optimize Threshold Settings">
    * Start with a threshold of 0.5 and adjust based on results
    * Higher thresholds (0.7-0.9) reduce false positives
    * Lower thresholds (0.3-0.5) capture more objects but may include noise
  </Accordion>

  <Accordion title="Review and Refine">
    * Always review automatically generated annotations
    * Use CVAT's manual annotation tools to correct mistakes
    * Consider using automatic annotation as a starting point, not the final result
  </Accordion>
</AccordionGroup>

## Troubleshooting

### Model Not Appearing

* Verify your Roboflow API key is correct
* Ensure the model is public or you have access permissions
* Check your network connection and firewall settings

### Poor Annotation Quality

* Adjust the confidence threshold
* Try a different model that better matches your data
* Ensure your images are similar to the model's training data

### API Rate Limits

Roboflow has API rate limits based on your plan:

* **Free plan**: Limited API calls per month
* **Paid plans**: Higher limits and faster processing

If you hit rate limits, consider upgrading your Roboflow plan or spacing out your annotation tasks.

## Additional Resources

* [Roboflow Universe](https://universe.roboflow.com/)
* [Roboflow Documentation](https://docs.roboflow.com/)
* [How to Use CVAT (Roboflow Guide)](https://blog.roboflow.com/cvat/)
* [Using Roboflow Models in CVAT](https://blog.roboflow.com/how-to-use-roboflow-models-in-cvat/)
* [CVAT Blog: Integrating Roboflow and Hugging Face](https://www.cvat.ai/post/integrating-hugging-face-and-roboflow-models)
