shared_elements.py
File Path: src/data/shared_elements.py
Purpose: UI components shared across Streamlit dashboard pages.
Overview
Provides standardized widgets for selecting samples and configuring visualization options (body parts, drawing styles) to ensure consistency across different analysis views.
Functions
get_visual_controls(total_samples, rnd_key)
Returns: (idx, draw_lines, draw_points, separate_view, active_slices)
UI Elements Created:
- Number Input: “Sample Index”.
- Checkboxes: “Lines”, “Points”, “Only one” (View Mode).
- Conditionals:
- If “Only one”: Selectbox for Body Part (Pose/Face/RH/LH).
- If “Separated”: Multi-checkboxes for enabling parts.
Logic:
- Uses
rnd_keyto ensure unique widget IDs when reused. - Maps user selection to
active_slicesusingKP2SLICE.
Related Documentation
Depends On:
- mediapipe_utils.py -
KP2SLICE.
Used By: