/cvat-gradio

Load CVAT datasets into Gradio

Primary LanguagePython

CVAT-Gradio

Programatically load CVAT bounding box datasets into Gradio using the CVAT SDK.

Installation

Install the required packages using the following command:

pip install 'cvat_sdk[pytorch]' gradio

Load Dataset into CVAT

Next, load your dataset into CVAT and annotate it. Optionally, you can load publicly available datasets.

In my setup, I loaded the Aquarium dataset from Roboflow. The dataset consists of bounding boxe annotations for the following classes:

  • fish
  • jellyfish
  • penguins
  • sharks
  • puffins
  • stingrays
  • starfish

cvat

Pulling Dataset from CVAT

We can use the CVAT SDK to pull the dataset from CVAT into a PyTorch Dataset object.

In the most basic form:

from cvat_sdk import make_client
from cvat_sdk.pytorch import TaskVisionDataset

client = make_client(host, port=port, credentials=(user, password))
dataset = TaskVisionDataset(client, task_id)

## Visualize in Gradio and share

Read more here

Running the Gradio App

Run the Gradio demo app using the following code snippet:

python run_gradio.py
2024-07-02.20-13-51.mp4