Giter Site home page Giter Site logo

body-language-decoder's Introduction

Real-time Body Language Recognition using Mediapipe and Machine Learning

This project demonstrates a real-time body language recognition system using Mediapipe for extracting body landmarks and various machine learning algorithms for classification. The main goal is to capture body posture and facial expressions through a webcam, process the data to extract meaningful features, and classify the body language using a pre-trained machine learning model.

Table of Contents

Introduction

This project uses Mediapipe Holistic, an ML pipeline that provides features to detect human pose, face, and hand landmarks. We then use these landmarks to train machine learning models that can classify different body language states.

Features

  • Real-time capture and processing of webcam feed.
  • Extraction of pose and facial landmarks using Mediapipe.
  • Training and saving machine learning models.
  • Predicting body language classes in real-time.
  • Displaying predictions and probabilities on the video feed.

Installation

  1. Clone the repository:

    git clone https://github.com/BhanuSaketh/Body-Language-Decoder.git
    cd BodyLanguageDecoder
  2. Install required packages:

    pip install -r requirements.txt

    The requirements.txt file should contain:

    opencv-python
    numpy
    matplotlib
    mediapipe
    pandas
    scikit-learn
    

Usage

  1. Prepare your dataset:

    Ensure you have a CSV file (coords.csv) containing landmark coordinates and their corresponding classes. The dataset should have columns for each coordinate and a 'class' column for labels.

  2. Real-time prediction:

    Run the script to start the webcam feed and make real-time body language predictions:

    python code.py

Dataset

The dataset should be a CSV file (coords.csv) containing the coordinates of landmarks detected by Mediapipe, along with a 'class' column that contains the labels for different body language states.

Real-time Prediction

The script code.py uses the webcam feed to capture real-time video, processes the frames to extract pose and facial landmarks using Mediapipe, and predicts the body language class using the pre-trained model. The predictions and probabilities are then displayed on the video feed.

Results

The system displays the predicted body language class and its probability directly on the video feed, providing real-time feedback on body language recognition.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

body-language-decoder's People

Contributors

bhanusaketh 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.