Git Product home page Git Product logo

stgat's Introduction

STGAT

This repo holds the code for: Skeleton-Based Action Recognition with Local Dynamic Spatial-Temporal Aggregation (pdf) (Previous name: Spatial Temporal Graph Attention Network for Skeleton-Based Action Recognition(pdf))

Data Preparation

Training & Testing

Change line 10 in train.py to the absolute path of this STGAT repo you download.

Set the data_path and label_path to the path of your dataset in line 4,5,13,14, and specify the cuda_visible_device & device_id in line 61, 62, of /train_val_test/config/your_dataset/your_config_file.yaml, respectively.

Change the config file depending on what you want.

`python train_val_test/train.py -config ./train_val_test/config/your_dataset/your_config_file.yaml`

Train with decoupled modalities by changing the 'num_skip_frame'(None to 1 or 2) option and 'decouple_spatial'(False to True) option in config file and train again.

Then combine the generated scores with:

`python train_val_test/ensemble.py`

Visualization

To visualize the attention weights of the center frame, you could first (1) select an index of input samples, and only pass this sample to the training process by uncommenting line 51 in ./train_val_test/train_val_model.py and change 'xxxx' into the index you select. Note that you should indent line 52~line 101, and change the training batch size into 1 in the config file (e.g., line 51 in ./train_val_test/config/ntu/ntu60_dsta.yaml); (2) uncomment line 217 in ./model/st2ransformer.py. After that, you should train or test this code (with pretrained weights) on a dataset you desire. You could get a 'stgat_attention.npy' under your folder. Next, run the 'ntu_visualize_add_attention.py' with desired parameter. Note that the indices you pass into the py file should be consistent with that in the './train_val_test/train_val_model.py'.

You may also change some hyperparameters in the files to change the visualization results (e.g., the threshold of line 209 in 'ntu_visualize_add_attention.py').

stgat's People

Contributors

hulianyuyy 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.