Skip to content
ptonsoPublic

About

Computer vision CLI for dataset work: convert annotations, auto-label, caption, classify, OCR, generate images and clean datasets.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

cvsuite

cvsuite is a computer vision toolkit for reproducible, filesystem-to-filesystem dataset work, organized around one CLI:

cvsuite <branch> <src> [transform] <output>

Convert between annotation formats (YOLO, COCO, LabelMe, class folders, segmentation masks, VQA manifests). Auto-label raw images from a text prompt with foundation grounding models such as SAM 3 or Grounding DINO. Caption them or answer questions about them with vision-language models. Sort them into class folders with zero-shot classifiers. Read text off them with OCR. Generate and edit images with diffusion models. Then do the unglamorous half of the job: unzip and flatten a dump of files, drop exact and near-duplicates, fix orientation, normalize size and format, and draw a balanced sample for training.

cvsuite label ./dataset-yolo to-coco ./dataset-coco
cvsuite label ./images ground --provider gsam --prompt "fire" to-results ./labeled
cvsuite vlm ./images caption --provider qwen to-json ./captions
cvsuite class ./images infer --provider clip --prompt "good,bad" to-class-dir ./sorted
cvsuite gen create --provider flux --prompt "a red fox in the snow" to-dst ./fox.png
cvsuite prep arrange ./dump ./clean --unzip --exact-dedup --rename-seq

Examples

To generate these examples locally, run ./scripts/generate_examples.sh.

Image Generation (cvsuite gen)

cvsuite gen create --provider stable_diffusion --precision fp16 --prompt "a red fox in the snow" to-dst ./fox.png

A red fox in the snow

Zero-Shot Grounding (cvsuite label ground)

cvsuite label ./images ground --provider gsam --prompt "fire" to-results ./labeled

Fire detection with grounding overlay

OCR Text Detection (cvsuite label ocr)

cvsuite label ./images/ocr.jpg ocr --provider paddleocr to-results ./ocr-out

OCR text detection with recognized boxes

Recognized text:

Recognized text

Visual Question Answering (cvsuite vlm ask)

cvsuite vlm ./images/dog.jpg ask --prompt "How many dogs are in this image?" --provider qwen to-json ./answers

Dog photo used for VQA

Generated answer (see docs/example_data/answers/dog.json):

Generated answer

More in the cookbook.

You point a branch at a source, optionally run a transform, and materialize a destination layout. There is deliberately no universal "convert anything to anything" command.

How it works

flowchart LR
    SRC["source<br/>yolo · coco · labelme<br/>images · shards · …"] --> TOOL

    TOOL{"pick a tool<br/>label · class · vlm · gen"} -->|ingest| DS["VisionDataset"]

    DS --> TF["one transform<br/>sample · ground · ocr<br/>infer · caption · vqa"]
    TF -->|"chain runs to stack"| DS

    DS -->|output command| DST["destination<br/>yolo · coco · class-dir<br/>json · shards · …"]
Loading

Whichever tool you pick, the spine is the same: the source is ingested into a shared VisionDataset, transforms mutate that dataset, and an output command materializes it. What differs per tool is the ingest heuristics, which transforms exist, and the export rules.

Each run applies at most one transform, so you stack them by chaining runs: the destination of one becomes the source of the next. FM-backed transforms (ground, ocr, infer, caption, vqa, and the gen actions) hand the dataset to an isolated provider subprocess that mutates records in place. cvsuite prep is the exception to all of this, since it works directly on folders and never builds a dataset.

Branches

Branch Purpose
cvsuite label annotated datasets: YOLO / COCO / LabelMe / image-only ingest, sample / ground / ocr / ops / filter transforms, export to any label format
cvsuite class class-directory datasets: infer with zero-shot classifiers, class-aware sample, export via to-class-dir
cvsuite vlm vision-language datasets: caption / ask / vqa / map-answers, export to flat JSON / shards / VQA-style
cvsuite gen text-to-image and image-edit generation, materialized via to-dst
cvsuite prep raw image folder cleanup: arrange / process / sample / orient, file-first
cvsuite common shared operations: FM cache paths, inspection, and purge

Install

pip install cv-suite

Or from source:

git clone https://github.com/ptonso/cv-suite
pip install -e ./cv-suite

The base install ships the CLI and the I/O layer. Foundation-model backends run in isolated per-model virtualenvs provisioned on first use. See docs/getting-started.md.

Documentation

  • docs/ contains the guides: the mental model, getting started, and a cookbook of common workflows.
  • specs/ is the technical source of truth: architecture, the dataset contract, per-branch behavior, and the constraints that must not break.

Names

  • PyPI distribution: cv-suite
  • import package and CLI: cvsuite

License

MIT. See LICENSE.

About

Computer vision CLI for dataset work: convert annotations, auto-label, caption, classify, OCR, generate images and clean datasets.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages