Skip to content

Add coco_visualize_videos CLI for rendering video frames with annotations#10

Open
Erotemic wants to merge 4 commits into
prepare_geowatch_portsfrom
codex/create-cli-module-for-visualize_videos
Open

Add coco_visualize_videos CLI for rendering video frames with annotations#10
Erotemic wants to merge 4 commits into
prepare_geowatch_portsfrom
codex/create-cli-module-for-visualize_videos

Conversation

@Erotemic
Copy link
Copy Markdown
Member

Motivation

  • Provide a first-class kwcoco CLI to render video frames (and optional annotation overlays) to disk for inspection and debugging.
  • Port the core, generally useful visualization functionality from the legacy dev/to_port/coco_visualize_videos.py while removing project-specific heuristics and deprecated logic.
  • Keep a lightweight, robust interface that can operate on small in-memory datasets for CI or local smoke tests.

Description

  • Added kwcoco/cli/coco_visualize_videos.py that registers a visualize CLI (alias visualize_videos) implemented with scriptconfig and supporting channel selection, per-video output folders, draw controls (draw_imgs, draw_anns, draw_boxes, draw_segmentations, draw_labels), simple scaling (min_dim, max_dim), and other rendering options.
  • Vendored and adapted only two small helper routines from the legacy utilities: perchannel_colorize and ensure_false_color with a short header comment noting the original source and adaptation.
  • Registered the new CLI module in the main CLI registry by adding coco_visualize_videos to kwcoco/cli/__main__.py.
  • Added a minimal smoke test tests/test_cli_visualize_videos.py that programmatically builds a tiny kwcoco dataset, runs the CLI (__cli__.main(...)) and asserts that visualization images are produced.
  • Intentionally omitted/removed: GeoWATCH/SMART-specific heuristics and activity-label assumptions, the legacy animation wrapper, and the select_fixed_normalization fixed-normalization selection and other deprecated flags.

Testing

  • Ran the smoke test via python -m pytest tests/test_cli_visualize_videos.py which passed locally.
  • The smoke test constructs a tiny dataset (2 frames, 1 video), invokes the CLI with cmdline=False, and asserts that output images are written to the viz folder.
  • No additional heavy dependencies or external services were required for the smoke test and it completed successfully.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant