Git Product home page Git Product logo

multi-landmark-tracking's Introduction

Multi Landmarks Tracking with OpenCV and Mediapipe

Overview

This Python script utilizes the Mediapipe library to perform multi-landmark tracking in real-time. It incorporates three main components: Pose Estimation, Face Detection, and Hand Tracking. The script captures video from the webcam, overlays detected landmarks on the face, hands, and human pose, and displays the result in a resizable window.

Table of Contents

Prerequisites

  • Python 3.x
  • OpenCV (pip install opencv-python)
  • Mediapipe (pip install mediapipe)

Installation

  1. Clone the repository:
git clone https://github.com/Mayur-ingole/Multi-Landmark-Tracking.git
cd Multi-Landmarks-Tracking
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Run the script:
python Multi_Landmarks_Tracking.py
Press 'q' to exit the application.

Features

  • Pose Estimation: Tracks the human body pose.
  • Face Detection: Detects and tracks faces in the video stream.
  • Hand Tracking: Tracks hand landmarks and connections.

Understanding the Script

Components

  • Pose Estimation (mp_pose): Utilizes the Mediapipe Pose model to estimate human body pose, including landmark locations for various body parts.
  • Face Detection (mp_face): Employs the Mediapipe Face Detection model to detect and track faces in the video stream. It extracts bounding box coordinates for each detected face.
  • Hand Tracking (mp_hands): Uses the Mediapipe Hands model to track hand landmarks and connections. It provides coordinates for each hand landmark and visualizes connections between them.

Functions

  • estimate_pose(frame): Estimates the pose landmarks in a single frame using the Mediapipe Pose model.
  • estimate_face(frame): Estimates the face landmarks in a single frame using the Mediapipe Face Detection model.
  • estimate_hands(frame): Estimates the hand landmarks in a single frame using the Mediapipe Hands model.
  • draw_face_landmarks(frame, landmarks): Draws bounding boxes around detected faces on the frame.
  • draw_hand_landmarks(frame, landmarks): Draws hand landmarks and connections on the frame using Mediapipe drawing utilities.
  • draw_landmarks(frame, landmarks): Draws pose landmarks on the frame using Mediapipe drawing utilities.

Propagating Poses

  • propagate_pose(prev_pose, current_pose): Propagates poses from the previous frame to the current frame. If the previous pose is not available, it returns the current pose; otherwise, it averages the previous and current poses.
  • propagate_poses(frames): Propagates poses across frames. It estimates poses for each frame, propagates them based on the previous frame's pose, and visualizes face and hand landmarks.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

multi-landmark-tracking's People

Contributors

mayur-ml avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.