Skip to content

feat: Add getitrack video I/O, annotators, and detector adapters#6915

Open
omkar-334 wants to merge 10 commits into
open-edge-platform:feature/getitrackfrom
omkar-334:getitrack-video
Open

feat: Add getitrack video I/O, annotators, and detector adapters#6915
omkar-334 wants to merge 10 commits into
open-edge-platform:feature/getitrackfrom
omkar-334:getitrack-video

Conversation

@omkar-334

Copy link
Copy Markdown
Contributor

Adds the video I/O, visualization, and detector-adapter layer for getitrack.

Included

  • io/: VideoReader and VideoWriter, OpenCV context managers over BGR uint8 frames.
  • visualization/: TrackAnnotator (draws boxes, ids, class names, and scores) and VideoAnnotator (annotate and write straight to a video file). Track colors are deterministic per id.
  • adapters/: a DetectionAdapter interface and GetiAdapter, which wraps a getitune detector into getitrack Detections. getitune and torch are imported lazily, so getitrack installs without them.

Dependencies

  • Builds on the core PR for Detections / TrackedDetections. This branch is stacked on getitrack-core-v2, so the diff includes the core changes until that PR merges into feature/getitrack.
  • The CLI and public-API exports are not part of this PR; they depend on the ByteTrack PR and follow separately.

Testing

  • Unit tests for the readers/writers, annotators, and adapters. Adapter tests that need getitune are skipped when it is not installed.

@github-actions github-actions Bot added DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM TEST Any changes in tests BUILD labels Jun 25, 2026
@omkar-334

Copy link
Copy Markdown
Contributor Author

need to rebase this once #6796 is merged. This PR contains commits from that pr

@kprokofi kprokofi self-assigned this Jun 29, 2026
@kprokofi kprokofi self-requested a review June 29, 2026 15:42
@kprokofi kprokofi added the GSoC label Jun 29, 2026
@kprokofi

Copy link
Copy Markdown
Contributor

@omkar-334, please, rebase

Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated
Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated
Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated

@kprokofi kprokofi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall, the structure looks good. However, as Leo already mentioned, typing is done badly. Could you work to type your variables / entities properly? Try to avoid using noqa/ignore if possible

Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated
Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated
Comment thread libraries/getitrack/src/getitrack/adapters/geti.py Outdated
Comment thread libraries/getitrack/src/getitrack/visualization/annotator.py Outdated
@kprokofi kprokofi requested review from Copilot and removed request for Radwan-Ibrahim and samet-akcay July 1, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the “integration layer” around getitrack’s core detection/track types: OpenCV-backed video I/O, utilities for drawing tracked detections onto frames and emitting annotated videos, and a detector-adapter interface plus a getitune-backed adapter (with lazy imports so getitrack can be installed without torch/getitune).

Changes:

  • Added VideoReader / VideoWriter context managers for iterating and writing BGR uint8 frames via OpenCV.
  • Added TrackAnnotator / VideoAnnotator + deterministic per-track coloring for visualization.
  • Added DetectionAdapter interface and a GetiAdapter to convert getitune outputs into getitrack Detections, plus unit tests (skipping getitune/torch-dependent tests when not installed).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libraries/getitrack/src/getitrack/io/video.py Implements OpenCV-backed VideoReader/VideoWriter context managers and frame validation.
libraries/getitrack/src/getitrack/io/init.py Exposes video I/O types from the getitrack.io package.
libraries/getitrack/src/getitrack/visualization/annotator.py Implements drawing of tracked detections and a writer-composition helper (VideoAnnotator).
libraries/getitrack/src/getitrack/visualization/init.py Exposes visualization utilities from the getitrack.visualization package.
libraries/getitrack/src/getitrack/adapters/base.py Defines the DetectionAdapter interface for framework-agnostic detection.
libraries/getitrack/src/getitrack/adapters/geti.py Adds GetiAdapter with lazy torch/getitune usage and batch→Detections conversion.
libraries/getitrack/src/getitrack/adapters/init.py Exposes adapter types from the getitrack.adapters package.
libraries/getitrack/tests/unit/test_video_io.py Unit tests for video I/O roundtrips, metadata, and error cases.
libraries/getitrack/tests/unit/test_annotator.py Unit tests for annotator behavior, labels, colors, and video annotation output.
libraries/getitrack/tests/unit/test_adapters.py Unit tests for adapter conversions and optional getitune/torch-dependent preprocessing/detect.

Comment thread libraries/getitrack/src/getitrack/io/video.py
Comment thread libraries/getitrack/src/getitrack/io/video.py
Comment thread libraries/getitrack/src/getitrack/io/video.py
Comment thread libraries/getitrack/src/getitrack/adapters/geti.py
@omkar-334 omkar-334 requested a review from a team as a code owner July 2, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUILD DEPENDENCY Any changes in any dependencies (new dep or its version) should be produced via Change Request on PM GSoC TEST Any changes in tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants