Skip to content

Dev silvio#21

Merged
SilvioGiancola merged 19 commits into
mainfrom
dev-silvio
Apr 30, 2026
Merged

Dev silvio#21
SilvioGiancola merged 19 commits into
mainfrom
dev-silvio

Conversation

@SilvioGiancola
Copy link
Copy Markdown
Collaborator

No description provided.

…ionality

- Updated `MediaController` initialization in `main_window.py` to use the center panel directly.
- Modified media routing and playback control signals to streamline interactions with the media controller.
- Introduced `FramePreviewLabel` class in `media_player` for handling frame previews, including resizing and clearing functionality.
- Enhanced error handling in `MediaErrorDialog` for better user feedback on media playback issues.
- Added support for handling `.npy` frame stacks in dataset explorer and media controller, including tests for loading and navigating frames.
- Updated tests to cover new frame stack functionalities and ensure proper media state management during tab switches and event navigation.
- Included `numpy` as a dependency in `requirements.txt` for frame handling.
… tool

- Introduced tests for adding tracking parquet data and verifying sample creation in `test_core_lifecycle.py`.
- Implemented tests for handling tracking parquet data in dataset explorer regressions.
- Enhanced media player controls to support play, pause, and seek functionalities for tracking parquet files.
- Added tests for handling invalid schemas and missing dependencies for tracking parquet files.
- Created a new visualization tool `visualize_tracking.py` to render tracking events from PFF and FIFA formats, including side-by-side video and tracking visualizations.
- Updated existing tests to include tracking parquet paths and functionalities across various workflows.
- Introduced a new internal media playback backend structure under `controllers/media/`.
- Created `BaseMediaBackend` as a contract for all media backends.
- Implemented specific backends for frames (`FramesNpyMediaBackend`), raster images (`BaseRasterMediaBackend`), tracking data (`TrackingParquetMediaBackend`), and video (`VideoMediaBackend`).
- Enhanced `MediaController` to manage backend-specific parsing and rendering.
- Updated `MediaCenterPanel` documentation to reflect changes in playback logic and backend handling.
- Improved error handling and validation for media loading across different backends.
…it parameters

- Updated `HfDownloadDialog` and `HfUploadDialog` to replace URL input with repo ID, revision, and split fields.
- Modified methods for adding/removing successful transfers in settings to accommodate new transfer structure.
- Adjusted payload handling in download/upload functions to utilize the new parameters.
- Updated documentation and test cases to reflect changes in the download/upload process.
- Ensured backward compatibility by normalizing transfer data and updating relevant tests.
…ctures

- Updated UI to replace question tabs with a question group layout, allowing multiple answers per question.
- Modified JSON structure to eliminate top-level `questions` and use grouped answers format.
- Adjusted documentation to reflect changes in Q/A payload structure and editing process.
- Implemented conversion scripts to migrate legacy VQA JSON files to the new grouped format.
- Enhanced tests to validate new answer grouping functionality and ensure backward compatibility.
- Updated test names for better readability and accuracy.
- Replaced direct text setting in tests with monkeypatching for dialog inputs.
- Enhanced assertions to check the state of UI components more effectively.
- Added new tests for double-click editing and context menu actions on answers.
- Ensured that the answer list and question list interactions are properly validated.
Copilot AI review requested due to automatic review settings April 30, 2026 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 migrates dataset tooling and the GUI application to newer OpenSportsLib APIs, expands media support beyond standard video (frame stacks + tracking parquet), and updates the Q/A workflow to a grouped per-sample answers schema (dropping the legacy dataset-level questions bank).

Changes:

  • Add/refresh CLI tools for HF upload/download and dataset preparation (224p conversion, VQA migration, label merge), routing through opensportslib.tools.
  • Replace legacy Q/A (questions + question_id) with per-sample grouped answers (answers[{question, answers[]}]) across UI, controllers, docs, and tests.
  • Introduce media playback backends for frames_npy and tracking_parquet, plus dataset explorer confidence display/sorting support.

Reviewed changes

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

Show a summary per file
File Description
tools/upload_dataset_to_hf.py New CLI for uploading OSL JSON/parquet to HF via opensportslib.tools.hf_transfer.
tools/parquet_webdataset_to_osl_json.py Switch conversion import to opensportslib.tools.
tools/osl_json_to_parquet_webdataset.py Switch conversion import to opensportslib.tools, add shard mode/size CLI options.
tools/merge_mvfouls_classification_into_vqa.py New utility to merge MVFouls classification labels into XFoul VQA JSON.
tools/download_osl_hf.py New CLI for downloading HF dataset splits via opensportslib.tools.hf_transfer.
tools/convert_legacy_vqa_to_grouped.py New migration tool: legacy VQA (questions + question_id) → grouped per-sample answers.
tools/convert_dataset_videos_to_224p.py New tool to transcode all video inputs to 224p and rewrite JSON paths.
tools/README.md Expanded tooling docs (usage/examples), plus HF transfer notes.
tests/test_upload_dataset_to_hf_tool.py Unit tests for the new upload tool routing and error-handling behavior.
tests/test_parquet_conversion_tools.py Removed legacy parquet conversion round-trip tests (conversion moved to opensportslib).
tests/test_opensportslib_api_migration.py Tests to validate new opensportslib model API usage (weights/train_set/valid_set, etc.).
tests/test_convert_xfoul_to_qa.py Adds test coverage for grouped VQA answers emitted by XFoul converter.
tests/test_convert_legacy_vqa_to_grouped.py Tests for legacy VQA → grouped conversion behavior.
tests/test_convert_dataset_videos_to_224p.py Tests for 224p video conversion tool behavior and failure handling.
tests/gui/test_workflow_question_answer.py GUI workflow tests updated for grouped Q/A UI (lists + dialogs, multi-answer).
tests/gui/test_workflow_localization.py GUI tests expanded for frame stack/tracking parquet navigation + confidence label suffix.
tests/gui/test_workflow_dense_description.py GUI tests updated for media_controller.current_position_ms() and new modalities.
tests/gui/test_workflow_classification.py GUI tests assert dataset explorer conf suffix updates on infer/confirm.
tests/gui/test_signal_decoupling_contract.py Updates expected signal wiring (Q/A catalog signal name changes, removes question-bank wiring).
tests/gui/test_media_player_controls.py Adds GUI tests for frames_npy/tracking_parquet playback/seek/errors.
tests/gui/test_history_stack_contract.py Updates Q/A history contract to grouped answer editing/add flows.
tests/gui/test_dataset_explorer_regressions.py Updates persistence/regression tests for grouped answers and new modalities.
tests/gui/test_dataset_explorer_focused.py Updates dataset normalization tests and adds confidence sort/label tests.
tests/conftest.py Refines opensportslib stubbing (stub opensportslib.model), improves Qt plugin path setup/teardown.
tests/README.md Updates test docs to reflect the refined opensportslib stubbing behavior.
test_data/upload_osl_hf.py Removes older HF upload helper script (replaced by tools-based approach).
test_data/download_osl_hf.py Updates HF download helper script to split-based API via opensportslib.
test_data/README.md Updates HF download instructions and VQA format notes to grouped answers.
requirements.txt Adds numpy/pandas/pyarrow and bumps opensportslib requirement to >=0.1.3.
docs/shortcuts.md Removes unused shortcut notes.
docs/index.md Updates screenshot and clarifies Q/A is now stored in answers only.
docs/gui_overview.md Updates Q/A UI description to list-based grouped workflow.
docs/getting_started.md Updates Q/A description to grouped question/answer workflow.
docs/editing.md Updates Q/A editing instructions to dialog + list workflow.
docs/batch_tools.md Updates HF download parameters (repo/revision/split/format) and parquet sharding description.
docs/annotating.md Updates Q/A how-to steps for grouped answers.
docs/OSL.md Updates schema docs: Q/A is now grouped answers; documents legacy migration tool.
annotation_tool/ui/question_answer/question_answer_annotation_panel.ui Reworks Q/A panel UI from tabs + editor to lists + buttons.
annotation_tool/ui/question_answer/init.py Implements new Q/A panel behavior/signals for grouped questions and multi-answer lists.
annotation_tool/ui/question_answer/README.md Updates Q/A panel contract documentation for grouped workflow.
annotation_tool/ui/media_player/init.py Adds FramePreviewLabel and panel support for raster rendering surfaces (non-video).
annotation_tool/ui/media_player/README.md Documents media panel support for both Qt video and raster preview surfaces.
annotation_tool/ui/dataset_explorer_panel/init.py Adds natural sort role, confidence suffix display helper, and “Sort by conf” checkbox.
annotation_tool/tools/parquet_to_osl_json.py Removes internal parquet→OSL JSON converter (superseded by opensportslib).
annotation_tool/tools/osl_json_to_parquet.py Removes internal OSL JSON→parquet converter (superseded by opensportslib).
annotation_tool/tools/init.py Removes old public conversion API exports (moved to opensportslib).
annotation_tool/main_window.py Updates wiring for new media controller facade, Q/A catalog signal, and adds Help menu dialogs.
annotation_tool/controllers/question_answer/README.md Updates controller docs for grouped Q/A payload and dialog-driven edits.
annotation_tool/controllers/media/video_backend.py Adds dedicated video backend used by MediaController.
annotation_tool/controllers/media/raster_backend.py Adds shared timer-driven raster playback backend.
annotation_tool/controllers/media/frames_npy_backend.py Adds frames_npy backend (NumPy-loaded frame stacks → QImage).
annotation_tool/controllers/media/base.py Adds backend base contract used by MediaController.
annotation_tool/controllers/media/init.py Exposes internal media backend classes.
annotation_tool/controllers/localization/localization_editor_controller.py Prevents selection signal churn while selecting rows by time.
annotation_tool/controllers/localization/loc_inference.py Updates inference integration to new opensportslib API (weights/use_wandb, prediction normalization).
annotation_tool/controllers/localization/README.md Removes outdated opensportslib version caveat.
annotation_tool/controllers/history_manager.py Removes dataset-level question bank mutation commands; adapts answer normalization call.
annotation_tool/controllers/hf_transfer_controller.py Migrates HF download/upload worker calls to new opensportslib split-based API and shard params.
annotation_tool/controllers/classification/train_manager.py Migrates training to new opensportslib ClassificationModel.train(train_set, valid_set, use_wandb=False).
annotation_tool/controllers/classification/inference_manager.py Migrates inference to new opensportslib ClassificationModel.infer(weights=..., use_wandb=False).
annotation_tool/controllers/README.md Documents new media backend architecture under controllers/media/.
annotation_tool/app_info.py Adds centralized app name/version and shortcuts help text.
annotation_tool/README.md Updates documented input modalities and Q/A schema.
README.md Updates top-level HF download instructions to repo/revision/split/format workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +164 to +168
parser.add_argument(
"--split",
default=None,
help="Remote split/artifact name. JSON uploads <split>.json; parquet uploads <split>/.",
)
Comment thread tools/README.md
Comment on lines +362 to +366
Both scripts require `opensportslib` latest version

```bash
pip install opensportslib==0.1.3
pip install -e ~/git/opensportslib/
Comment thread tools/README.md
Comment on lines +371 to +375
**Basic Command:**

```bash
python test_data/download_osl_hf.py \
--repo-id <org>/<dataset> \
Comment thread tools/download_osl_hf.py
Comment on lines +7 to +12
REPO_ROOT = Path(__file__).resolve().parents[1]
if str(REPO_ROOT) not in sys.path:
sys.path.insert(0, str(REPO_ROOT))

from opensportslib.tools.hf_transfer import download_dataset_split_from_hf

@SilvioGiancola SilvioGiancola merged commit 84e9cfb into main Apr 30, 2026
4 checks 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