Git Product home page Git Product logo

voxel-based-actionrecognition's Introduction

Introduction

This project presents the code for the paper A 3D Reconstruction and Action Recognition Method for Construction Workers Using Voxel-Based Approach.

In the paper, a voxel-based approach for worker behavior recognition is proposed, which consists of four modules: detection, pose estimation, voxelization and classification. By transforming image data into structured voxel data, this project presents the concrete implementation of the method.

Overview of the Our Method

Updates

Getting Start

Generate voxel

Our project is based on a Windows10 system with a RTX 3060Ti GPU and python 3.7.12, and we remind you that python >= 3.7 is necessary. It support both GPU and CPU,but we recomend using GPU for convenience.

Create Enviornment for Python

conda create -n my_env python=3.7
conda activate my_env
pip install -r requirments.txt
pip install vedo

Clone this repo

git clone https://github.com/SuperCarry2001/Voxel-Based-ActionRecognition.git

Install CUDA, torch, and Cudatoolkit (optional, for GPU)

Install suitable version CUDA. conda install cudatoolkit==10.1 cudnn==7.6.0 Make sure pytorch and torchvision are installed on your python enviornment and suitable for your CUDA.

Install YOLOv3 and MOT

pip install git+https://github.com/mkocabas/yolov3-pytorch.git
pip install git+https://github.com/mkocabas/multi-person-tracker.git

Reset YOLO config files

Modify the paths of weights_path and model_def in yolo.py, where the code would normally be located at:

package of yolov3-pytorch/yolov3/yolo.py

The package of yolov3-pytorch above means the path you clone YOLOv3.

The Weights_path is the path to weight-file of YOLOv3 which is trained on MOCS dataset.The model_def is the path to yolov3-modified.cfg which is in our repo.

Download pretrained weights

Here we provide url, you should download and unzip them under the folder data/vibe_data separately.

Running our Demo

Replace the input file path and output folder path with your own path

cd to this repo
conda activate my_env

# Run on a local video 
python demo_2voxel.py --input_file 'input file path' --output_folder 'output folder path'
python demo_2voxel.py --input_file ./images/demo.gif --output_folder ./result

demo-visualizaiton

demo-visualizaiton

Voxel Data download link

Our dataset is open access for public, and you can download CAVC dataset via the link. Test set you can download here.

dataset-visualizaiton

For data augmentation as shown in our paper, we provide code below. python data_augmentation.py

Voxel Visualization

Replace the 'your voxel file path' with your own path python vis-vox.py --file_path 'your voxel file path'

Replace the 'your voxel folder path' with your own path python batch_vis.py --folder_path 'your voxel folder path'

voxel-visualizaiton

Training

Running the code, and before that you should replace the path witn your own path.

python train.py

Testing

We release our trained weight file as best.pth, you should replace its path in test.py. You can use the code to calculate acc, recall and F1 score.

python test.py

Reference

Here are some great resources we benefit:

  • YOLOv3 for detecting workers is from YOLOv3.
  • MOCS for training YOLOv3 is from MOCS dataset.
  • VIBE for regress worker's pose is from VIBE.
  • SMPL for generate voxels is from SMPL.
  • VEDO for visualization is from VEDO.

voxel-based-actionrecognition's People

Contributors

supercarry2001 avatar

Stargazers

 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.