feat: Add getitrack video I/O, annotators, and detector adapters#6915
feat: Add getitrack video I/O, annotators, and detector adapters#6915omkar-334 wants to merge 10 commits into
Conversation
|
need to rebase this once #6796 is merged. This PR contains commits from that pr |
|
@omkar-334, please, rebase |
e5b3540 to
2d96f8f
Compare
kprokofi
left a comment
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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/VideoWritercontext managers for iterating and writing BGR uint8 frames via OpenCV. - Added
TrackAnnotator/VideoAnnotator+ deterministic per-track coloring for visualization. - Added
DetectionAdapterinterface and aGetiAdapterto convert getitune outputs into getitrackDetections, 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. |
Adds the video I/O, visualization, and detector-adapter layer for getitrack.
Included
io/:VideoReaderandVideoWriter, OpenCV context managers over BGR uint8 frames.visualization/:TrackAnnotator(draws boxes, ids, class names, and scores) andVideoAnnotator(annotate and write straight to a video file). Track colors are deterministic per id.adapters/: aDetectionAdapterinterface andGetiAdapter, which wraps a getitune detector into getitrackDetections. getitune and torch are imported lazily, so getitrack installs without them.Dependencies
Detections/TrackedDetections. This branch is stacked ongetitrack-core-v2, so the diff includes the core changes until that PR merges intofeature/getitrack.Testing