Skip to main content

A data processing library for computer vision datasets

Project description

DataFlow-CV

Where Vibe Coding meets CV data. ๐ŸŒŠ Convert & visualize datasets. Built with the flow of Claude Code.

Python Version License Version Development Status

A data processing library for computer vision datasets, focusing on format conversion and visualization between LabelMe, COCO, and YOLO formats. Provides both a CLI and Python API.

Table of Contents

Project Structure

dataflow/
โ”œโ”€โ”€ __init__.py              # Package exports and convenience functions
โ”œโ”€โ”€ cli.py                   # Command-line interface
โ”œโ”€โ”€ config.py                # Configuration management
โ”œโ”€โ”€ convert/                 # Format conversion module
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ base.py             # Converter base class
โ”‚   โ”œโ”€โ”€ coco_to_yolo.py     # COCO to YOLO converter
โ”‚   โ””โ”€โ”€ yolo_to_coco.py     # YOLO to COCO converter
tests/
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ convert/                # Conversion tests
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_coco_to_yolo.py
โ”‚   โ””โ”€โ”€ test_yolo_to_coco.py
โ”œโ”€โ”€ run_tests.py           # Test runner
samples/
โ”œโ”€โ”€ __init__.py
โ”œโ”€โ”€ cli/                   # CLI usage examples
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ convert/
โ”‚       โ”œโ”€โ”€ cli_coco_to_yolo.py
โ”‚       โ””โ”€โ”€ cli_yolo_to_coco.py
โ””โ”€โ”€ api/                   # Python API examples
    โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ convert/
        โ”œโ”€โ”€ api_coco_to_yolo.py
        โ””โ”€โ”€ api_yolo_to_coco.py

Requirements

Core Dependencies

  • Python 3.8 or higher
  • Linux environment (POSIX compatible, assumes POSIX paths)
  • click >= 8.1.0 โ€“ CLI framework
  • numpy >= 2.0.0 โ€“ numerical operations
  • opencv-python >= 4.8.0 โ€“ image processing (optional, used for some image operations)
  • Pillow >= 10.0.0 โ€“ image reading (optional, used for reading image dimensions)

Quick Start

Installation

# Install
pip install .

Command Line Usage

Global options: --verbose (-v) for progress output, --overwrite to replace existing files.

# COCO to YOLO conversion
dataflow convert coco2yolo annotations.json output_dir/

# YOLO to COCO conversion
dataflow convert yolo2coco images/ labels/ classes.names output.json

# Show configuration
dataflow config

# Get help
dataflow --help
dataflow convert coco2yolo --help

See the CLI Reference below for detailed usage.

Python API Usage

import dataflow

# COCO to YOLO
result = dataflow.coco_to_yolo("annotations.json", "output_dir")
print(f"Processed {result['images_processed']} images")

# YOLO to COCO
result = dataflow.yolo_to_coco("images/", "labels/", "classes.names", "output.json")
print(f"Generated {result['annotations_processed']} annotations")

CLI Reference

The CLI follows a hierarchical structure: dataflow <mainโ€‘task> <subโ€‘task> [arguments]. Global options can be placed before the main task.

Global Options

  • --verbose, -v: Enable verbose output (progress information)
  • --overwrite: Overwrite existing files

Conversion Commands

COCO to YOLO

dataflow convert coco2yolo COCO_JSON_PATH OUTPUT_DIR [--segmentation]
  • COCO_JSON_PATH: Path to COCO JSON annotation file
  • OUTPUT_DIR: Directory where labels/ and class.names will be created
  • --segmentation, -s: Handle segmentation annotations (polygon format)

YOLO to COCO

dataflow convert yolo2coco IMAGE_DIR YOLO_LABELS_DIR YOLO_CLASS_PATH COCO_JSON_PATH
  • IMAGE_DIR: Directory containing image files
  • YOLO_LABELS_DIR: Directory containing YOLO label files (.txt)
  • YOLO_CLASS_PATH: Path to YOLO class names file (e.g., class.names)
  • COCO_JSON_PATH: Path to save COCO JSON file

Configuration Command

dataflow config

Shows the current configuration (file extensions, default values, CLI context).

Getting Help

dataflow --help
dataflow convert --help
dataflow convert coco2yolo --help
dataflow convert yolo2coco --help

Running Tests

# Run all tests
python tests/run_tests.py

# Run specific test
python tests/run_tests.py --test TestCocoToYoloConverter

# With verbose output
python tests/run_tests.py -v

Examples

Check the samples/ directory for detailed usage examples:

  • samples/cli/convert/ - CLI usage examples
  • samples/api/convert/ - Python API examples

License

MIT License ยฉ 2026 zjykzj

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

dataflow_cv-0.2.0.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataflow_cv-0.2.0-py3-none-any.whl (31.4 kB view details)

Uploaded Python 3

File details

Details for the file dataflow_cv-0.2.0.tar.gz.

File metadata

  • Download URL: dataflow_cv-0.2.0.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.1

File hashes

Hashes for dataflow_cv-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d5bd2ce4ee7c7db03ee7a33c8883750584157e2f326a3614713117d7ed1168d
MD5 67146bbe78793a5e4be3ffcd55e814fa
BLAKE2b-256 54fd437bf5eb52838552c5eacf6ad4b9d57b20ffc8e770901f530e54d62ed65c

See more details on using hashes here.

File details

Details for the file dataflow_cv-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dataflow_cv-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.1

File hashes

Hashes for dataflow_cv-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 495f2be46fc3e21422b682062316df6e1091c6f3e2c10860b59368d2b13f2275
MD5 311fd868e2aa5c97f14953c7759c68e8
BLAKE2b-256 40bbed0cd11f2cc9d87e981bf228567e566e624bbe5c0c8273b27fa165642cfe

See more details on using hashes here.

Supported by

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