Skip to main content

A utility for working with CVAT data flow

Project description

CVAT DATA FLOW

New

  • Add support for export in YOLOv8 segmentation and detection formats (for segmentation dataset_format = "yolo_seg")
  • Add support for installation via pip
  • Add support for downloading multiple tasks from different projects

Overview

This utility facilitates the download of datasets from CVAT, preparing them for training and testing purposes. Key features include:

  • Downloading datasets from CVAT in any supported format.
  • Merging multiple tasks to form a consolidated dataset.
  • Randomly segmenting the dataset into training, validation, and testing subsets.

Local Installation

Clone the repository:

git clone https://github.com/ai-iaguzhinskii/cvat_data_flow.git

Install the dependencies:

pip3 install -r requirements.txt

Configuration

Edit the configuration as per your requirements in the config_file:

[CVAT]
URL = # URL of the CVAT server, e.g., http://localhost:8080
LOGIN = # CVAT user login, e.g., admin
PASS = # CVAT user password, e.g., admin

[DOWNLOAD]
TASKS_IDS = # Task IDs for downloading, e.g., [111, 222, 333]
PROJECTS_IDS = # Project IDs for downloading, e.g., [111, 222, 333]

[DATASET]
FORMAT = # Desired dataset format. Refer to CVAT documentation for options, e.g., coco
# For YOLOv8 segmentation and detection formats use "yolo_seg" and "yolo_det" respectively
SAVE_PATH = # Directory to save the downloaded datasets, e.g., /home/user/datasets
SPLIT = # Define random splits for the dataset, e.g., {"train": 0.8, "val": 0.1, "test": 0.1}

[OPTIONS]
ONLY_BUILD_DATASET = # Toggle to build dataset only if tasks are previously downloaded, e.g., True
LABELS_MAPPING = # Define label mappings, e.g., {"car": "vehicle", "person": "pedestrian"}
DEBUG = # Toggle debug mode, e.g., True

Usage

To run the program:

python3 cvat_data_flow/main.py

Note: Ensure to replace placeholders in the configuration with actual values before executing.

Installation via PIP

The utility can be installed via pip:

pip3 install cvat-data-flow

Usage as a Python Package

The utility can also be used as a Python package. Here's an example:

from cvat_data_flow import CVATDataFlow

cvat_data_flow = CVATDataFlow(
        url='http://cvat.example.com',
        login='username',
        password='password',
        save_path='/path/to/save/dataset',
        projects_ids=[1, 2, 3],
        only_build_dataset=False,
        dataset_format='coco',
        split=[('train', 0.7), ('val', 0.2), ('test', 0.1)],
        labels_mapping={'person': 'person', 'car': 'vehicle'}
    )

cvat_data_flow.download_data()
cvat_data_flow.build_dataset()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvat_data_flow-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

cvat_data_flow-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file cvat_data_flow-0.1.0.tar.gz.

File metadata

  • Download URL: cvat_data_flow-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for cvat_data_flow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2cb50aa11f1e723436ec714180d4bd0c522d2ed79672f26d925972c15c4294fb
MD5 a1bf73b712cb51a9f3c45f37fc27d5a3
BLAKE2b-256 1367b1e22d869ddae0c95fc9c5d6b3c734116491d1498eb4de020628d0366f7f

See more details on using hashes here.

File details

Details for the file cvat_data_flow-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cvat_data_flow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f8041bd77fc6c296176e46628eca39212a381280b41776e7e5681577175e916
MD5 934a0381018970c324c4ff0f4829fa4e
BLAKE2b-256 0256970dc1ac5d86decf9ce937333d1220c0f7dfe5375aec9b4acdc3ce304203

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page