Skip to content

A real-time system to classify single-object behaviour. Using MediaPipe Pose and Tensorflow with LSTM model to not only inference on trained model, but also to train.

License

Notifications You must be signed in to change notification settings

phuc16102001/behaviour-classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Behaviour classification

tensorflow python

Introduction

A real-time system to classify single-object behaviour. Using MediaPipe Pose and Tensorflow with LSTM model to not only inference on trained model, but also to train.

Gallery

train

Training process

inference

Inference process

Architecture

In each frame of picture, the MediaPipe Pose library first detect poses' landmark. Each landmark not only contains two coordinates (x, y, z, visibility). Then, these landmarks will be used to train a RNN model which contains LSTM layers. Furthermore, the model also attached some drop-out layers to reduce overfitting.

model

Model architecture (from AI Design)

Usage

Firstly, please do install all the required libraries using the command:

pip install -r requirements.txt

You can either use the pre-trained model in models/best.h5, or train a new one by yourself. In this case, the instruction will train a new model.

At the first stage, you need to generate a new dataset. For each class, you need to run the gen_data.py:

python gen_data.py

After generating all the classes in data, run the train.py to train the model:

python train.py

The training process will generate a model in models/best.h5. At this moment, you can run the model:

python inference.py

Contribution

This project was developed by phuc16102001 and referencing from Mi AI.

License

MIT

About

A real-time system to classify single-object behaviour. Using MediaPipe Pose and Tensorflow with LSTM model to not only inference on trained model, but also to train.

Topics

Resources

License

Stars

Watchers

Forks

Languages