Skip to content

vis compare flag + uv changes + git workflow - #72

Merged
harshi-puli merged 1 commit into
revampfrom
286065
Aug 17, 2026
Merged

vis compare flag + uv changes + git workflow#72
harshi-puli merged 1 commit into
revampfrom
286065

Conversation

@harshi-puli

Copy link
Copy Markdown
Contributor

vis.py --compare mode, uv migration, CI re-enable

Summary

  • vis.py: new --compare <algo> flag. Runs a second registered algo for the same --task on identical frames and stacks its debug-frame grid below the primary algo's in one "Debug Frames" window (not beside it, so neither pane's width shrinks). Each half is corner-labeled with its algo name; sliders for both algos share the window, prefixed by algo name (e.g. center: canny_low) so they don't collide.
  • Switched from conda to uv for environment/Python-version management. setup.py replaced with pyproject.toml; README installation instructions rewritten accordingly.
  • Re-enabled CI (.github/workflows/ci.yml): restored push/pull_request triggers (previously workflow_dispatch-only) and dropped the lint job — ruff/black aren't gating yet, since the repo carries pre-existing style debt (226 ruff errors / 40 files needing reformat, even excluding _archive/ and the vendored third_party/sort submodule) unrelated to this change. test-classical is unchanged and passing.
  • Renamed perception/tasks/_archive/slot_machine/slot_machine_test.pyslot_machine_demo.py. It wasn't a real test (no assertions, just an old exploratory OpenCV script using a deprecated cv.findContours API) — it only got swept into pytest collection because its filename matched pytest's *_test.py discovery pattern, which was blocking every other test in the suite from running.

How to test --compare

source .venv/bin/activate   # see uv setup below if you don't have this yet

# Two gate algos, stacked in one window, on real course footage
python -m perception.vis.vis --task gate --algo center --compare segmentation_a \
  --data course_footage/GOPR1142.MP4 --resize 0.3

# Try other pairs
python -m perception.vis.vis --task gate --algo segmentation_a --compare segmentation_b \
  --data course_footage/GOPR1142.MP4 --resize 0.3

# Bad --compare value exits with the available-algos list instead of a traceback
python -m perception.vis.vis --task gate --algo center --compare nope \
  --data course_footage/GOPR1142.MP4

# Save the combined, labeled view to vis_rec.mp4
python -m perception.vis.vis --task gate --algo center --compare segmentation_a \
  --data course_footage/GOPR1142.MP4 --resize 0.3 --save_video

q/Esc quits, p pauses, i/o slow down/speed up playback. slalom only has one registered algo (classical) right now, so there's nothing to compare it against yet.

uv setup vs. the old conda flow

Step Old (conda) New (uv)
One-time tool install Install Miniconda curl -LsSf https://astral.sh/uv/install.sh | sh (or brew install uv)
Get Python 3.11 conda create -n urobotics python=3.11 uv venv --python 3.11 (downloads 3.11 automatically if missing, creates .venv/ in the repo)
Activate conda activate urobotics source .venv/bin/activate
Install the package pip3 install -e ./ uv pip install -e .
Install deps pip3 install -r requirements-classical.txt uv pip install -r requirements-classical.txt
Torch/YOLO extras pip3 install -r requirements-torch.txt uv pip install -r requirements-torch.txt

Everything downstream (Cython build, python -m perception.vis.vis ..., pytest) is unchanged once the venv is activated. Env is now per-repo (.venv/ inside perception/, gitignored) rather than one shared named conda env.

CI workflow change

Before: on: workflow_dispatch only (manual-trigger-only, lint + test-classical jobs, both effectively dead since nothing ran automatically).

After: on: push / pull_request / workflow_dispatch (runs automatically again), lint job removed, test-classical job unchanged. Verified locally end-to-end (submodule fetch, dependency install, Cython rebuild, pytest -v --tb=short) — 20 passed, 0 failed, only expected torch-not-installed skip warnings.

Out of scope / follow-up

  • Torch/YOLO/XFeat CI job — not added; classical-only per existing scope.

@harshi-puli
harshi-puli marked this pull request as ready for review August 17, 2026 01:42
@harshi-puli
harshi-puli merged commit db1e2d9 into revamp Aug 17, 2026
2 checks passed
@harshi-puli
harshi-puli deleted the 286065 branch August 18, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant