Add skeleton rendering and GUI integration#60
Draft
C-Achard wants to merge 2 commits intocy/camera-loader-fixesfrom
Draft
Add skeleton rendering and GUI integration#60C-Achard wants to merge 2 commits intocy/camera-loader-fixesfrom
C-Achard wants to merge 2 commits intocy/camera-loader-fixesfrom
Conversation
Introduce a new skeleton utility and integrate skeleton overlays into the GUI. Adds dlclivegui/utils/skeleton.py (SkeletonModel, Skeleton, loaders, render status/codes) and a helper to load DLC config skeleton. Wire skeleton drawing into display.draw_pose and the main window: add UI checkbox, auto-enable/disable logic, model-based skeleton configuration, and safe handling when keypoint counts or shapes mismatch. Also add a QScrollArea for the controls dock to allow scrolling. Remove unused demo code Add skeleton UI controls and gradient coloring Add UI and rendering support for configurable skeleton appearance: color mode (solid or keypoint-gradient) and line thickness. main_window.py: introduce skeleton color combo, thickness spinbox, handlers (_on_skeleton_style_changed, _sync_skeleton_controls_from_model), and wire these into model loading and drawing flow; enable/disable controls appropriately and preserve auto-disable behavior. gui/misc/color_dropdowns.py: add gradient swatch icon and helpers to create/populate/get/set a skeleton color combo (supports Gradient and solid BGR swatches). utils/display.py: add keypoint_colors_bgr(colormap, num_keypoints) to produce exact BGR colors from a Matplotlib colormap and remove direct skeleton coupling from draw_pose. utils/skeleton.py: ensure draw_many forwards style, color_override and keypoint_colors to per-pose draw calls and validates pose shapes/keypoint counts. Overall this enables gradient coloring of skeleton lines based on keypoint colormap and exposes user controls to tweak skeleton rendering.
Introduce a first-class SkeletonStyle and SkeletonColorMode (and BGR alias) in config, and wire them through the GUI and skeleton utilities. Updates include: - dlclivegui/config.py: add BGR type, SkeletonColorMode enum, Pydantic SkeletonStyle model, expose skeleton fields on VisualizationSettings and with_overlays on RecordingSettings, and helper color accessors. - dlclivegui/gui/main_window.py: add _apply_viz_settings_to_ui/_apply_viz_settings_to_skeleton, create a unified _draw_skeleton_on_frame renderer, read/write skeleton style from UI, refactor and simplify skeleton enable/disable and model heuristics, and wire recording.with_overlays. - dlclivegui/gui/misc/color_dropdowns.py: reuse BGR from config. - dlclivegui/utils/skeleton.py: remove duplicate style/type definitions, import style and enums from config, and add module docstring. These changes centralize skeleton styling, enable UI control and persistence of style, and clean up duplicate definitions across modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a new skeleton utility and integrate skeleton overlays into the GUI.
This pull request adds comprehensive support for skeleton visualization in the main GUI window, allowing users to display and customize skeleton overlays based on model definitions. It introduces new UI controls for skeleton display and style, ensures compatibility with loaded models, and manages automatic enabling/disabling of skeleton features.
Additionally, the controls dock is improved for better layout and usability.
Skeleton visualization features:
_build_viz_group). These controls are enabled only when a compatible skeleton is available for the loaded model.config.yaml, synchronize UI controls with skeleton style, and automatically enable or disable skeleton controls based on model compatibility (_configure_skeleton_for_model,_sync_skeleton_controls_from_model)._render_overlays_for_recording,_try_draw_skeleton,_update_video_display). [1] [2] [3]_connect_signals,_on_show_skeleton_changed,_on_skeleton_style_changed). [1] [2]Controls dock usability improvements:
QScrollAreaand implemented logic to synchronize the dock’s minimum width with the controls content, ensuring proper layout and usability even with many controls (_setup_ui,_sync_controls_dock_min_width). [1] [2] [3]