hhe-distance / AIF-CNN

Convolutional Neural Network with Adaptive Inferential Framework for Skeleton-Based Action Recognition in PyTorch
7 stars 0 forks source link

A PyTorch Reimplementation of AIF-CNN

Features

1. Dataset

2. Tasks

3. Visualization

Prerequisites

Our code is based on Python3.5. There are a few dependencies to run the code in the following:

Usage

Data preparation

NTU RGB+D

To transform raw NTU RGB+D data into numpy array (memmap format ) by this command:

python ./feeder/ntu_gendata.py --data_path <path for raw skeleton dataset> --out_folder <path for new dataset>

To generate the bone information:

python ./feeder/ntu_gen_bone_data.py --data_path <path for raw skeleton dataset> --out_folder <path for new dataset>

To generate the core information:

python ./feeder/ntu_gen_core_data.py --data_path <path for raw skeleton dataset> --out_folder <path for new dataset>
Other Datasets

Not supported now.

Training

Before you start the training, you have to launch visdom server.

python -m visdom

To train the model, you should note that:

Testing

python main.py --dataset_dir <parents path for all the datasets> --mode test --load True --model_name AIF_CNN --dataset_name NTU-RGB-D-CV --num 01

Load and Training

You also can load a half trained model, and start training it from a specific checkpoint by the following command:

python main.py --dataset_dir <parents path for all the datasets> --mode load_train --load True --model_name AIF_CNN --dataset_name NTU-RGB-D-CV --num 01 --load_model <path for  trained model>

Results

Extracting feature

python main.py --dataset_dir <parents path for all the datasets> --mode test --load True --model_name AIF_CNN --dataset_name NTU-RGB-D-CV --num 01

Ensemble results

Combine the generated scores with:

python merge_for_cs.py/merge_for_cv.py

Reference

[1] Chao Li, Qiaoyong Zhong, Di Xie, Shiliang Pu. Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation. IJCAI 2018. http://arxiv.org/pdf/1804.06055.pdf

[2] huguyuehuhu/HCN-pytorch.

[3] kenziyuliu/Unofficial-DGNN-PyTorch.