Git Product home page Git Product logo

shoplifting2222's Introduction

Human Activity Recognition using Deep Learning

This Python code demonstrates human activity recognition using a pre-trained model and MediaPipe for pose estimation. It reads a video input or a live web-cam feed, captures frames, and predicts the activity in the captured frames using a deep neural network.

Requirements:

To run this code, you need to have the following packages installed:

  • collections
  • numpy
  • opencv-python
  • mediapipe
  • onnx

Download the model and place it in the model Directory

https://drive.google.com/drive/folders/1QCpoHJG33_uIEwv5TZ06Siwb6xYHoMaH?usp=sharing

Running the Code

To run the code, execute the following command in your terminal:

  • python live.py

This will start capturing frames from your default webcam. If you want to use a video file instead of the webcam

  • python video.py

Press the q key to exit the application.

Code Overview

The Parameters class initializes important paths and constants for the code.

  • A double-ended queue named captures is created to store the captured frames.
  • The pre-trained human activity recognition model is loaded using OpenCV's cv2.dnn.readNet function.
  • The MediaPipe pose estimation is set up.
  • The captured frames are processed and resized and are added to the deque.
  • The code predicts the activity in the captured frames using the pre-trained model.
  • The MediaPipe is used to estimate the pose in the captured frames.
  • The predicted activity and pose are drawn on the captured frames.
  • The captured frames are displayed on the screen.

Acknowledgments

This code is based on the tutorial by Adrian Rosebrock on PyImageSearch Human Activity Recognition with OpenCV and Deep Learning. https://pyimagesearch.com/2019/11/25/human-activity-recognition-with-opencv-and-deep-learning/

shoplifting2222's People

Contributors

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