A powerful, interactive application that detects and visualizes human body keypoints and skeletons in real-time. This project leverages the power of OpenCV DNN and Google MediaPipe to provide accurate pose estimation for both static images and live video streams.
- Image-Based Estimation: Upload any image (JPG, JPEG, PNG) and visualize the estimated pose skeleton using OpenCV's DNN module.
- Real-Time Video Processing: Utilize MediaPipe for high-performance, real-time pose tracking from video files or live webcam feeds.
- Interactive Controls: Adjust detection thresholds on-the-fly using the Streamlit dashboard.
- Deep Learning Powered: Uses pre-trained TensorFlow models (
graph_opt.pb) and MediaPipe's optimized pipelines.
- Frontend: Streamlit
- Computer Vision: OpenCV, MediaPipe
- Deep Learning: TensorFlow (Inference via OpenCV DNN)
- Language: Python 3.x
Ensure you have Python installed. We recommend creating a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate-
Clone the repository:
git clone https://github.com/yourusername/human-pose-estimation.git cd human-pose-estimation -
Install the required dependencies:
pip install streamlit opencv-python mediapipe numpy pillow
-
Ensure you have the model weights:
- The project uses
graph_opt.pbfor OpenCV-based detection.
- The project uses
Launch the interactive web interface to process static images:
streamlit run st1_basic.py- Upload: Use the sidebar or main area to upload an image.
- Threshold: Adjust the slider to fine-tune the confidence level for keypoint detection.
- Results: View the original and processed images side-by-side.
For video processing and MediaPipe-based real-time estimation:
- Open
video_pose.ipynbin your preferred editor (VS Code, JupyterLab). - The notebook is configured to process
run1.mp4by default but can be toggled to use your Webcam (0).
The model detects 18 key body parts, including:
- Nose, Neck
- Shoulders (R/L), Elbows (R/L), Wrists (R/L)
- Hips (R/L), Knees (R/L), Ankles (R/L)
- Eyes (R/L), Ears (R/L)
.
├── graph_opt.pb # Pre-trained TensorFlow model weights
├── st1_basic.py # Streamlit application source code
├── video_pose.ipynb # MediaPipe video processing notebook
├── run1.mp4 # Sample video for testing
├── stand.jpg # Sample image for testing
└── README.md # Project documentation
Contributions are welcome! If you have ideas for improvements or find any issues, feel free to open a Pull Request or create an Issue.
Developed with ❤️ by [Rupkatha]
