Skip to content

Adding Algo Registration + Connecting to Vis - #70

Merged
kvaikunthan merged 5 commits into
masterfrom
revamp
Aug 14, 2026
Merged

Adding Algo Registration + Connecting to Vis#70
kvaikunthan merged 5 commits into
masterfrom
revamp

Conversation

@harshi-puli

Copy link
Copy Markdown
Contributor

Summary

Replaces the manually-maintained ALGOS dict with decorator-based algorithm registration, wired through to vis.py.

  • perception/tasks/registry.py (new): @register_perceiver(task=..., algo=...) decorator, plus get_perceiver, list_tasks, list_algos, discover_all(). Discovery walks perception.tasks and imports everything so decorators actually run — no shared file to hand-edit per new algorithm. Skips _archive/ and swallows any import failure (missing torch/kornia/tqdm, etc.) with a warning, so one broken/optional module can't block discovering the rest.
  • Exisited Tasks: Current Task specifc class files were wrapped to be able to fit with the Task Perceiver process.
  • vis.py: --algorithm/ALGOS replaced with --task/--algo via the registry. Unknown pairs now fail with a clear list of what's actually registered instead of a bare KeyError.
  • Tests: registry behavior (lookup, duplicate keys, discovery) + per-task perceiver tests for slalom and path_marker.
  • CI: temporarily disabled github workflow.

Verified

All three tasks run clean through the real vis.py CLI (synthetic + real footage). Full suite passes (20/20, excluding _archive's unrelated pre-existing breakage). Lint checked against pre-edit baseline on every touched file — no new findings.

  • Verified that it also works on images and videos alike.

Test plan

  • pytest --ignore=perception/tasks/_archive
  • python -m perception.vis.vis --task <gate|slalom|path_marker> --algo <...> --data <path>
  • Confirm an invalid --task/--algo prints the available list

@harshi-puli
harshi-puli requested review from kvaikunthan and a lite review from Copilot August 13, 2026 07:29
@harshi-puli
harshi-puli marked this pull request as ready for review August 13, 2026 07:29
@harshi-puli
harshi-puli removed the request for review from Copilot August 13, 2026 07:29

@kvaikunthan kvaikunthan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts tuff

@kvaikunthan
kvaikunthan merged commit 3f1a6f8 into master Aug 14, 2026
1 check passed
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.

2 participants