Skip to main content

A utility for working with CVAT data flow

Project description

CVAT DATA FLOW

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
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,
        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.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

cvat_data_flow-0.0.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cvat_data_flow-0.0.1.tar.gz
  • Upload date:
  • Size: 9.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.0.1.tar.gz
Algorithm Hash digest
SHA256 390ce3dc4b86fad8a3b9852db1ef703f276d9a9df78b5e058a9d29b0c5169135
MD5 93922026eeedbd04aaaa96e32b590ff3
BLAKE2b-256 1127871cefdb6ae5ea3b6066f6a31a20fd33eeff2a6cf79c7afd5886768ca353

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cvat_data_flow-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9e18a781c9e5e380029786caf6abb903f47a8ace1a7d3332f35a9590f2a5253
MD5 28ac04e6679a139c62060c9ed62c9e58
BLAKE2b-256 67379e848da24ffb3258cf0e770afa6ebdf4ccd06a7ef4b1079cdb3e8bc5108d

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