CoolFace
Apppublic

Rsharan622244/human-action-recognition-lrcn

sourceHugging Facemitupdated 4mo agoView on Hugging Face
0likes
App README

Human Action Recognition using LRCN

Overview

This project is a deep learning-based Human Action Recognition system that classifies actions from video sequences using an LRCN (Long-term Recurrent Convolutional Network) architecture.

The application supports both:

  • Video file uploads
  • YouTube video URLs

and predicts the action being performed in the video.

The model was trained on four action classes and achieved 87% classification accuracy.


Features

  • Upload local video files for prediction
  • Predict actions directly from YouTube videos
  • Real-time video playback inside the application
  • Confidence scores for all classes
  • Streamlit-based interactive web interface
  • CNN + LSTM architecture for spatiotemporal feature learning

Action Classes

The model is trained to classify the following activities:

  • PullUps
  • TaiChi
  • Skijet
  • Billiards

Model Architecture

The project uses an LRCN (Long-term Recurrent Convolutional Network) architecture:

Video Frames → CNN Feature Extraction → Temporal Sequence Modeling (LSTM) → Softmax Classification

Architecture

  • TimeDistributed Conv2D (16 filters)
  • TimeDistributed MaxPooling2D
  • TimeDistributed Dropout
  • TimeDistributed Conv2D (32 filters)
  • TimeDistributed MaxPooling2D
  • TimeDistributed Dropout
  • TimeDistributed Conv2D (64 filters)
  • TimeDistributed MaxPooling2D
  • TimeDistributed Dropout
  • TimeDistributed Conv2D (64 filters)
  • TimeDistributed MaxPooling2D
  • TimeDistributed GlobalAveragePooling2D
  • LSTM (32 Units)
  • Dropout (0.5)
  • Dense (4, Softmax)

Dataset Preprocessing

Each video is processed as follows:

  • Extract 20 frames per video
  • Resize frames to 64 × 64 pixels
  • Normalize pixel values by dividing by 255
  • Create temporal sequences for LSTM processing

Input Shape:

(20, 64, 64, 3)


Performance

MetricValue
Accuracy87%
Classes4
Sequence Length20 Frames
Input Resolution64 × 64

Project Structure

text
Human-Action-Recognition/

├── app.py
├── predict.py
├── LRCN_model_4class_87acc.h5
├── requirements.txt
└── README.md

Installation

Clone the repository:

bash
git clone <repository-url>
cd Human-Action-Recognition

Create a virtual environment:

bash
python -m venv venv

Activate environment:

Windows

bash
venv\Scripts\activate

Install dependencies:

bash
pip install -r requirements.txt

Running the Application

Start the Streamlit server:

bash
streamlit run app.py

Open:

text
http://localhost:8501

Usage

Option 1: Upload Video

  1. 1.Upload a supported video file.
  2. 2.Wait for preprocessing and inference.
  3. 3.View the predicted action and confidence scores.

Option 2: YouTube URL

  1. 1.Paste a YouTube video URL.
  2. 2.Download and process the video.
  3. 3.View the prediction results.

Technologies Used

  • Python
  • TensorFlow / Keras
  • OpenCV
  • NumPy
  • Streamlit
  • yt-dlp

Future Improvements

  • Support for additional action classes
  • Real-time webcam prediction
  • Batch video processing
  • GPU inference optimization
  • Action localization within videos

Author

Rachuri Sharan

AI / Machine Learning Projects Human Action Recognition using LRCN