fork123aniket / Human-Activity-Recognition

Implementation for Video Human Activity Recognition using OpenCV

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Human Activity Recognition

This repository performs Human Activity Recognition, where given a video, the developed framework recognizes the activity of the object per-frame using a pre-Trained 3D convolutional ResNet-34 model. The applications of it includes:-

  • Automatically classifying/categorizing a dataset of videos on disk.
  • Verifying that a food service worker has washed their hands after visiting the restroom or handling food that could cause cross-contamination (i.e,. chicken and salmonella).
  • Monitoring bar/restaurant patrons and ensuring they are not over-served.

Requirements

  • NumPy
  • OpenCV
  • collections

Usage

Data

  • The pre-Trained 3D ResNet-34 model of the developed framework is trained on the Kinetics dataset.
  • It consists of:-
    • 400 human activity recognition classes
    • At least 400 video clips per class (downloaded via YouTube)
    • A total of 300,000 videos
  • The full list of classes the model can recognize can be seen here.

Training and Testing

  • The pre-Trained weights of the 3D convolutional ResNet-34 model, trained on the Kinetics dataset, can be downloaded from here.
  • To see the implementation of Human Activity Recognition without rolling prediction, check Human_Activity_Recognition.py. Moreover, to test this implementation on a test video, run the following command:- python Human_Activity_Recognition.py --model resnet-34_kinetics.onnx --classes Class_Labels/action_recognition_kinetics.txt --input example_activities.mp4
  • To see the implementation of Human Activity Recognition with rolling prediction, check Human_Activity_Recognition_Deque.py. Besides, run the following command to check the performance of this implementation:- python Human_Activity_Recognition_Deque.py --model resnet-34_kinetics.onnx --classes Class_Labels/action_recognition_kinetics.txt --input example_activities.mp4

Results

Below are some results of developed model on test videos:-

Test Video 1 Test Video 2 Test Video 3
alt text alt text alt text
Test Video 4 Test Video 5
alt text alt text

About

Implementation for Video Human Activity Recognition using OpenCV

License:MIT License


Languages

Language:Python 100.0%