Skip to content

Add optional pose/segmentation overlay copy to frame export#400

Merged
gbeane merged 2 commits into
mainfrom
feature/export-frame-overlay
Jun 19, 2026
Merged

Add optional pose/segmentation overlay copy to frame export#400
gbeane merged 2 commits into
mainfrom
feature/export-frame-overlay

Conversation

@gbeane

@gbeane gbeane commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Extends File → Export Frame with an option to also save an annotated copy of the frame.

Use case is to provide additional context when saving frames with pose or segmentation failures -- the raw frame can be used for labeling; the frame-with-overlay shows the failure.

What it does

  • The export save dialog gains a checkbox: "Also save a copy with pose/segmentation overlay (…-overlay.png)". When checked, alongside <name>.png it writes <name>-overlay.png.
  • The overlay copy is rendered at full native video resolution (matching the raw export) with:
    • Pose keypoints + skeleton for every identity.
    • Segmentation contours for every identity, when the pose file provides them (v6+); a no-op otherwise.
  • Every identity is drawn the same — pose at full opacity, all segmentation contours in one color. Unlike the live view, the export has no "active identity" highlight.
  • The checkbox state and the last-used directory are persisted in QSettings.

Implementation notes

  • New pose_drawing.py factors the skeleton/keypoint drawing into a shared, coordinate-transform-parameterized helper. PoseOverlay (the live, display-resolution overlay) now uses it too, so the on-screen overlay and the export share one code path. Segmentation reuses the existing overlay_segmentation from jabs.video_reader.
  • New PlayerWidget.get_overlay_frame() mirrors get_raw_frame() but bakes segmentation and paints the pose at native resolution.
  • The save dialog now uses Qt's non-native dialog, since native OS dialogs can't host the checkbox.

Tests & docs

  • New tests for the pose_drawing helper and the export handler's overlay path; the existing export-frame tests were updated for the new dialog.
  • Full suite green (718 passed); lint and format clean.
  • User guide updated in both copies (online docs/ and in-app help).

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

Extends the GUI’s File → Export Frame flow to optionally save a second “overlay” copy of the exported frame, rendered at native video resolution with pose skeleton/keypoints and (v6+) segmentation contours, while refactoring pose drawing into a shared helper used by both live overlay rendering and export.

Changes:

  • Added shared pose_drawing.py helper and updated the live PoseOverlay to use it.
  • Added PlayerWidget.get_overlay_frame() to render pose + segmentation overlays at native resolution for frame export.
  • Updated the export-frame save dialog to a non-native QFileDialog with a persistent “also save overlay copy” checkbox; updated tests and user guide docs accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/ui/test_pose_drawing.py Adds unit tests for the shared pose-drawing helper sizing and draw behavior.
tests/ui/test_menu_handlers.py Updates export-frame tests for the new non-native dialog + checkbox and adds overlay-export test coverage.
src/jabs/ui/player_widget/pose_drawing.py Introduces shared draw_identity_pose + native-resolution sizing helper.
src/jabs/ui/player_widget/player_widget.py Adds get_overlay_frame() for native-res overlay rendering and exports.
src/jabs/ui/player_widget/overlays/pose_overlay.py Refactors live overlay drawing to use the shared pose-drawing helper.
src/jabs/ui/main_window/menu_handlers.py Adds checkbox-enabled export path for optional “-overlay.png” copy and persists checkbox state.
src/jabs/resources/docs/user_guide/gui.md Updates in-app user guide text for the new export option.
docs/user-guide/gui.md Updates online user guide text for the new export option.

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

Comment thread src/jabs/ui/player_widget/player_widget.py
@gbeane gbeane merged commit b5216ca into main Jun 19, 2026
5 checks passed
@gbeane gbeane deleted the feature/export-frame-overlay branch June 19, 2026 18:53
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