A real-time boxing assistant application that uses computer vision and machine learning to track, count, and analyze your punches.
- 📹 Real-time webcam punch detection
- 🔍 Advanced pose estimation using TensorFlow's MoveNet
- 👊 Detects and classifies different punch types (jabs, crosses, hooks, uppercuts)
- 📊 Live statistics and performance tracking
- 🎯 Visual feedback for punch detection
- 🔧 User calibration for personalized detection
- 💾 Session history and progress tracking
- 📈 Performance analytics and visualization
- Machine Learning: TensorFlow + TensorFlow Hub
- Computer Vision: OpenCV
- Data Processing: NumPy
- Visualization: Matplotlib
- Data Storage: SQLite
- Python 3.8 or higher
- Webcam
- Required libraries (see requirements.txt)
-
Clone the repository:
git clone https://github.com/yourusername/punchtracker.git cd punchtracker
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the application:
python main.py
-
Controls:
ESC
: Exit the applicationC
: Start calibrationD
: Toggle debug view (shows skeleton)R
: Reset current sessionS
: Show detailed statistics
-
Calibration:
- Follow the on-screen instructions to calibrate the application to your movements
- Move through each step of different punch types
- The system will adjust its detection parameters to your specific style
All session data is stored in a local SQLite database in the data
folder. This includes:
- Session date and duration
- Total punch count and types
- Punches per minute
- Historical performance data
punchtracker/
├── main.py # Main application entry point
├── requirements.txt # Required dependencies
├── data/ # Session data storage
├── models/ # Model storage (downloaded automatically)
└── utils/
├── pose_detector.py # TensorFlow pose detection module
├── punch_counter.py # Punch detection and classification
├── ui_manager.py # UI and visualization components
├── data_manager.py # Data storage and retrieval
└── calibration.py # User calibration system
The application can be customized by modifying the following parameters:
- Pose Detection: Change model type in
pose_detector.py
(lightning or thunder) - Detection Sensitivity: Adjust thresholds in
punch_counter.py
- UI Customization: Modify colors and layout in
ui_manager.py
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE
file for details.
- TensorFlow for the MoveNet model
- OpenCV for computer vision capabilities
- NumPy and Matplotlib for data processing and visualization
Made with ❤️ by Anthony M