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.
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 frameworknumpy>= 2.0.0 โ numerical operationsopencv-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 fileOUTPUT_DIR: Directory wherelabels/andclass.nameswill 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 filesYOLO_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 examplessamples/api/convert/- Python API examples
License
MIT License ยฉ 2026 zjykzj
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d5bd2ce4ee7c7db03ee7a33c8883750584157e2f326a3614713117d7ed1168d
|
|
| MD5 |
67146bbe78793a5e4be3ffcd55e814fa
|
|
| BLAKE2b-256 |
54fd437bf5eb52838552c5eacf6ad4b9d57b20ffc8e770901f530e54d62ed65c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
495f2be46fc3e21422b682062316df6e1091c6f3e2c10860b59368d2b13f2275
|
|
| MD5 |
311fd868e2aa5c97f14953c7759c68e8
|
|
| BLAKE2b-256 |
40bbed0cd11f2cc9d87e981bf228567e566e624bbe5c0c8273b27fa165642cfe
|