Programatically load CVAT bounding box datasets into Gradio using the CVAT SDK.
Install the required packages using the following command:
pip install 'cvat_sdk[pytorch]' gradio
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
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
Run the Gradio demo app using the following code snippet:
python run_gradio.py