A modern desktop application for biomechanics motion analysis built on top of Sports2D. Analyze human motion from video with real-time skeleton overlays, joint angle tracking, and interactive kinematics graphs.
- One-Click Analysis — Run Sports2D pose estimation directly from the UI (no terminal needed)
- Skeleton Overlay — Real-time skeleton visualization with joint connections
- Click-to-Select — Click any joint on the video to select it for analysis
- 4 Interactive Graphs — Linear velocity (Vx, Vy, Vtotal), linear acceleration (Ax, Ay, Atotal), angular velocity, angular acceleration
- Calibration Tool — Draw a reference line on the video to convert from pixels to real-world units (meters)
- Trajectory Visualization — Absolute and relative (hip-centered) motion trails
- Joint Angle Overlay — Displays the angle value directly on the video
- Dark Mode UI — Modern Catppuccin-themed interface
- Python 3.10 or higher
# 1. Clone the repository
git clone [https://github.com/YOUR_USERNAME/sports2d-ui.git](https://github.com/Noureldin-Islam-2006/Motion-Analysis-Task1)
cd Motion-Analysis-Task1
# 2. Create a virtual environment (recommended)
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txtpython sports2d_ui.py-
Analyze a new video: Click ⚡ Analyze Video → browse for your video → set slowmo factor → click Run Analysis. The app runs Sports2D in the background and auto-loads results.
-
Load existing analysis: If you already ran Sports2D on a video (e.g.
slowmo.mp4with aslowmo_Sports2D/folder), click Load Existing and select the video. -
Select a joint: Click directly on any joint dot in the video. The side panel and all 4 graphs update instantly.
-
Calibrate: Click 📏 Calibrate → draw a line across a known distance → enter its real-world length in meters. All units convert from px to m.
-
Trajectories: Use the Show Trajectory / Show Relative Traj. buttons to visualize motion paths.
sports2d-ui/
├── sports2d_ui.py # Main application (single file)
├── requirements.txt # Python dependencies
├── .gitignore
└── README.md
When you analyze a video (e.g. video.mp4), Sports2D creates:
video_Sports2D/
├── video_Sports2D_px_person00.trc # Joint positions (pixels)
├── video_Sports2D_angles_person00.mot # Joint angles (degrees)
├── video_Sports2D_m_person00.trc # Joint positions (meters)
└── ...
| Package | Purpose |
|---|---|
PyQt5 |
GUI framework |
pyqtgraph |
High-performance interactive graphs |
QtAwesome |
Font Awesome icons |
opencv-python |
Video playback and drawing |
scipy |
Savitzky-Golay smoothing filter |
pandas / numpy |
Data loading and computation |
sports2d |
Pose estimation engine |
MIT License