Skip to content

This project uses machine learning to detect human body keypoints in images and videos. It supports real-time pose estimation for single or multiple people, with input from images, videos, and webcams. Ideal for applications like fitness tracking, augmented reality, and human-computer interaction.

Notifications You must be signed in to change notification settings

Sid-CodeX/Humanpose_Estimation

Repository files navigation

AICTE-INTERNSHIP-HUMAN-POSE-ESTIMATION

Human Pose Estimation using Machine Learning

This project focuses on implementing a human pose estimation system using machine learning techniques. It aims to detect and analyze human body key points from images or videos, enabling applications in areas like fitness tracking, gesture recognition, and augmented reality.

Table of Contents

About the Project

Human pose estimation is a computer vision technique that predicts the positions of key body joints (e.g., elbows, knees, shoulders). This project utilizes state-of-the-art machine learning models to achieve high accuracy in pose detection.

Features

  • Detects key body points in real-time.
  • Supports single-person and multi-person pose estimation.
  • Flexible input sources (images, videos, webcam).
  • Easy integration with downstream applications.

Technologies Used

  • Programming Languages: Python
  • Libraries: TensorFlow, PyTorch, OpenCV, NumPy, Matplotlib
  • Models: Pre-trained models like OpenPose, PoseNet, or custom-trained models.

Getting Started

Follow these steps to set up the project locally.

Prerequisites

Ensure you have the following installed:

  • Python 3.8 or later
  • Git
  • pip or conda

Installation

  1. Clone the repository:
    git clone https://github.com/sidharthp-2004/aicteinternship_humanpose_estimation.git
    cd aicteinternship_humanpose_estimation
  2. Create a virtual environment and active it:
    python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate Dataset This project uses the COCO Dataset for training and evaluation. You can download the dataset from COCO Official Website.

Model Details The model architecture is based on [Model Name]:

Input: RGB images of size X x Y. Output: Heatmaps for key body points. For training details, refer to train_model.py.

Contributing Contributions are welcome! Please follow these steps:

Fork the repository. Create a new branch (feature/add-feature). Commit your changes. Submit a pull request.

Contact For queries or feedback:

Email: [email protected] GitHub: sidharthp-2004 3.Streamlit Code : Below is the complete Streamlit code for your Human Pose Estimation project: import streamlit as st import cv2 import numpy as np from PIL import Image

Set Streamlit app configuration

st.set_page_config(page_title="Human Pose Estimation", layout="wide")

App title

st.title("Human Pose Estimation using Machine Learning") st.markdown("This app demonstrates human pose estimation using pre-trained machine learning models.")

Sidebar for navigation

st.sidebar.title("Navigation") options = st.sidebar.radio("Choose an option:", ["Overview", "Pose Estimation", "Methodology"])

Overview Section

if options == "Overview": st.header("Overview") st.markdown(""" Human pose estimation involves detecting key points of the human body, such as joints, in images or videos. This technique is widely used in applications like fitness tracking, augmented reality, and human-computer interaction. """)

st.subheader("Features")
st.markdown("""
- Real-time pose estimation
- Single-person and multi-person detection
- Works on images, videos, and webcam streams
""")

st.image("https://example.com/pose_image.jpg", caption="Example of Pose Estimation", use_column_width=True)

Pose Estimation Section

elif options == "Pose Estimation": st.header("Pose Estimation")

# Upload an image or video
upload_type = st.radio("Choose input type:", ["Image", "Video", "Webcam"])

if upload_type == "Image":
    uploaded_file = st.file_uploader("Upload an image", type=["jpg", "png", "jpeg"])
    if uploaded_file is not None:
        image = Image.open(uploaded_file)
        st.image(image, caption="Uploaded Image", use_column_width=True)

        # Placeholder: Simulated pose estimation
        st.write("Processing image for pose estimation...")
        st.image(image, caption="Pose Estimated Image", use_column_width=True)  # Replace with actual processed image

elif upload_type == "Video":
    uploaded_file = st.file_uploader("Upload a video", type=["mp4", "avi"])
    if uploaded_file is not None:
        st.video(uploaded_file)
        st.write("Processing video for pose estimation...")  # Placeholder for video processing

elif upload_type == "Webcam":
    st.write("Webcam feature coming soon!")  # Webcam implementation placeholder

Methodology Section

elif options == "Methodology": st.header("Methodology")

st.markdown("""
### Steps Involved in Human Pose Estimation
1. **Input Preprocessing**:
    - Resize and normalize the input image.
    - Convert image into a format suitable for the model.
2. **Pose Detection**:
    - Use a pre-trained machine learning model (e.g., OpenPose, PoseNet) to detect body keypoints.
3. **Post-Processing**:
    - Generate heatmaps and connect keypoints to form the skeletal structure.
4. **Output Visualization**:
    - Overlay detected keypoints and skeleton on the input image or video.
""")

st.subheader("Model Architecture")
st.image("https://example.com/model_architecture.jpg", caption="Model Architecture", use_column_width=True)

st.subheader("Dataset Used")
st.markdown("""
- **COCO Dataset**: Common Objects in Context, used for training and evaluation.
- **Keypoints**: The dataset provides annotations for 17 keypoints of the human body.
""")

3. Run the Streamlit App

Save the code in a file named app.py. Run the app using the command:

streamlit run app.py

About

This project uses machine learning to detect human body keypoints in images and videos. It supports real-time pose estimation for single or multiple people, with input from images, videos, and webcams. Ideal for applications like fitness tracking, augmented reality, and human-computer interaction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages