A powerful iOS application for analyzing human movement and biomechanics from video files. Built with SwiftUI and powered by the QuickPose SDK, this app tracks 33 body joints, measures joint angles, and exports detailed biomechanical data for further analysis.
- Video Analysis: Select and process videos to track human movement
- 33 Body Joint Tracking: Comprehensive tracking of all major body landmarks
- Multiple Visualization Modes:
- Whole Body Skeleton overlay
- Range of Motion & Angles measurements
- Biomechanical Measurements:
- Joint angle calculations (hip, knee, ankle, shoulder, elbow)
- Range of motion tracking for all major joints
- Real-time overlay visualization on processed videos
- Data Export: Export landmark data to CSV format for external analysis
- Processing History: View and manage previously analyzed videos
- Share & Save: Export processed videos and CSV files
The app provides an intuitive interface for:
- Selecting videos from your device
- Choosing visualization overlay types
- Monitoring processing progress
- Viewing detailed results with video playback
- Accessing processing history
- QuickPose SDK (requires SDK key)
- Clone the repository:
git clone https://github.com/yourusername/QP-Biomechanics-Demo.git
cd QP-Biomechanics-Demo- Open the project in Xcode:
open "QP-Biomechanics Demo.xcodeproj"-
Install dependencies:
- The project uses Swift Package Manager
- Dependencies will be automatically resolved when you open the project
- Required package: QuickPoseCore SDK
-
Configure your QuickPose SDK key:
- Open
QP-Biomechanics Demo/Config/QuickPoseConfig.swift - Replace
"YOUR SDK KEY HERE"with your actual QuickPose SDK key - Get your free SDK key at https://dev.quickpose.ai
- Open
-
Build and run the project in Xcode (⌘R)
To use this app, you need a QuickPose SDK key:
- Visit QuickPose Developer Portal
- Sign up for a free account
- Generate your SDK key
- Add it to
QuickPoseConfig.swift:
struct QuickPoseConfig {
static let sdkKey = "YOUR_SDK_KEY_HERE"
static let defaultIsFrontCamera = false
}You can customize various settings in QuickPoseConfig.swift:
- Camera Orientation: Set
defaultIsFrontCameratotrueif processing front-camera videos - CSV Export: Configure
includeConfidenceandpreviewRowCountin the CSV struct - Output Format: Adjust
outputVideoFormatin the Processing struct
- Launch the App: Open the app to see the main menu
- Select Video: Tap "Select Video to Analyze" and choose a video from your device
- Choose Overlay Type:
- Whole Body Skeleton: Shows complete body skeleton overlay
- Range of Motion & Angles: Shows joint angles and range of motion measurements
- Process Video: Tap "Start Processing" and wait for analysis to complete
- View Results: Review the processed video with overlays and landmark data
- Export Data: Share or save the processed video and CSV file
- Tap "View History" on the main screen
- Browse previously processed videos
- View detailed statistics and export data
- Delete old processing sessions
The exported CSV file contains frame-by-frame landmark data:
- Frame: Frame number in the video
- Timestamp: Time in seconds
- Joint Name: Name of the body landmark (e.g., "leftKnee", "rightShoulder")
- X, Y, Z: 3D coordinates of the landmark
- Visibility: Confidence score for landmark detection (0-1)
The app tracks 33 body landmarks:
Face: nose, eyes (inner, center, outer), ears, mouth corners
Upper Body: shoulders, elbows, wrists, hands (pinky, index, thumb)
Lower Body: hips, knees, ankles, heels, foot indices
QP-Biomechanics Demo/
├── Config/
│ └── QuickPoseConfig.swift # SDK configuration
├── Models/
│ ├── LandmarkData.swift # Data structures for landmarks
│ └── ProcessingHistory.swift # Processing session management
├── Views/
│ ├── ContentView.swift # Main app screen
│ ├── VideoPickerView.swift # Video selection interface
│ ├── VideoProcessingView.swift # Processing screen with overlays
│ ├── ProcessingResultsView.swift # Results display
│ └── HistoryView.swift # Processing history
├── Services/
│ └── CSVExporter.swift # CSV export functionality
├── Assets.xcassets/ # App assets
└── QP_Biomechanics_DemoApp.swift # App entry point
The app follows SwiftUI best practices with clear separation of concerns:
- Views: SwiftUI views for UI components
- Models: Data structures and business logic
- Services: Utility services (CSV export, etc.)
- Config: Configuration and constants
- QuickPosePostProcessor: Handles video processing and landmark detection
- ProcessingSession: Manages frame-by-frame landmark data
- CSVExporter: Exports landmark data to CSV format
- ProcessingHistory: Tracks and persists processing sessions
The app uses the QuickPose SDK to:
- Load video files from the device
- Process each frame to detect body landmarks
- Apply visual overlays (skeleton or biomechanics)
- Export processed video with overlays
Two overlay modes are available:
- Whole Body Skeleton: Complete body pose visualization
- Range of Motion & Angles: Detailed measurements including:
- Shoulder, elbow, hip, knee, and ankle angles
- Range of motion for major joints
- Hip-to-knee angle relationships
- Processing sessions are stored in memory during app runtime
- CSV files are saved to temporary directory
- Processed videos are saved to temporary directory
- Users can share/export files to permanent storage
- Video processing is performed asynchronously to prevent UI blocking
- Progress updates are throttled for smooth UI performance
- Large videos may take several minutes to process depending on:
- Video duration
- Video resolution
- Device processing power
"Invalid SDK Key" Error
- Verify your SDK key in
QuickPoseConfig.swift - Ensure you have an active QuickPose account
- Check your internet connection
Processing Fails
- Ensure the video contains visible human subjects
- Check that the video format is supported (MP4, MOV)
- Try with a shorter video first
CSV Export Fails
- Check available storage space
- Ensure the app has file system permissions
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please check with QuickPose for SDK licensing terms.
- Built with QuickPose SDK
- UI designed with SwiftUI
For questions or support, please open an issue on GitHub.
Note: This is a demonstration application. For production use, ensure proper error handling, data validation, and user privacy considerations are implemented.