app.py
source dashboard streamlit analytics
File Path: src/modelling/dashboard/app.py
Purpose: Entry point for the Streamlit-based KArSL Analytics Dashboard.
Overview
The dashboard provides a visual interface to explore model performance, inspect specific data samples, and experiment with data augmentations. It uses a sidebar for global configuration and a tabbed interface for focused analysis.
Dashboard Structure
Sidebar Configuration
- Checkpoint Selector: Lists all
.pthfiles found inTRAIN_CHECKPOINTS_DIR. - Split Selector: Choice between
train,val, andtestsplits. - Run Evaluation: Triggers the inference pipeline for the selected model and split.
Analysis Tabs
- Global Metrics: (Conditional) Displays confusion matrices and per-class performance plots.
- Error Analysis: (Conditional) Detailed view of prediction probabilities and specific misclassification instances.
- Sample Inspector: Explores the raw keypoints and labels of the dataset.
- Augmentation Lab: Interactive playground for testing
DataAugmentortransformations.
Workflow
- State Management: Uses
st.session_stateto persist evaluation results and random visualization keys. - Caching: Leverages
st.cache_dataandst.cache_resource(vialoader.py) for efficient model/data loading across reruns. - Dynamic Tabs: The “Global Metrics” and “Error Analysis” tabs only appear after an evaluation has been successfully run.
Key Functions
main()
Orchestrates the sidebar logic, state initialization, and tab rendering.