/GaitGraph2

Official code for "Towards a Deeper Understanding of Skeleton-based Gait Recognition" (CVPRW'22)

Primary LanguagePython

GaitGraph2: Towards a Deeper Understanding of Skeleton-based Gait Recognition

Accepted at: 17th IEEE Computer Society Workshop on Biometrics 2022 (CVPRW'22)

arxiv

Previous version:
GaitGraph: Graph Convolutional Network for Skeleton-Based Gait Recognition (ICIP'21)
github DOI:10.1109/ICIP42928.2021.9506717 arxiv

Preparation

git clone https://github.com/tteepe/GaitGraph2.git
conda create -n gait python=3.8
conda install pytorch==1.11.0 torchmetrics==0.11.4 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch -y
pip install pytorch-lightning==1.7
pip install pytorch-metric-learning pandas
pip install -U 'jsonargparse[signatures]'

conda install pyg -c pyg # no module named torch-sparse

pip install -e .

Datasets

  • CASIA-B: Download from here and move casia-b_pose_coco.csv to data
  • OUMVLP-Pose: Download from here

Pre-trained models

You can download pre-trained models from here.

Running the code

We use PyTorch Lightning CLI for configuration and training.

Train:

cd GaitGraph
# CASIA-B
python3 gaitgraph_casia_b.py fit --config configs/casia_b.yaml 
# OUMVLP-Pose (OpenPose)
python3 gaitgraph_oumvlp.py fit --config configs/oumvlp.yaml
# OUMVLP-Pose (AlphaPose)
python3 gaitgraph_oumvlp.py fit --config configs/oumvlp.yaml --data.keypoints alphapose

Test:

python3 gaitgraph_{casia_b,oumvlp}.py predict --config <path_to_config_file> --ckpt_path <path_to_checkpoint> --model.tta True

# example
python gaitgraph_oumvlp.py predict --config lightning_logs/version_0/config.yaml --ckpt_path lightning_logs/version_0/checkpoints/gaitgraph-oumvlp-epoch\=599-val_loss_epoch\=0.80.ckpt --model.tta True

Logs and checkpoints will be saved to lighting_logs and can be shown in tensorboard with:

tensorboard --logdir lightning_logs

Visualization of Activations

To run the visualization add run the following command:

python3 gaitgraph_{casia_b,oumvlp}.py predict --config <path_to_config_file> --ckpt_path <path_to_checkpoint> --config configs/draw.yaml --model.tta False

Examples:
002-06-01 008-255-00

Citation

If you use GaitGraph2, please use the following BibTeX entry.

@misc{teepe2022gaitgraph2,
  doi = {10.48550/ARXIV.2204.07855},
  url = {https://arxiv.org/abs/2204.07855},
  author = {Teepe, Torben and Gilg, Johannes and Herzog, Fabian and H\"ormann, Stefan and Rigoll, Gerhard},
  title = {Towards a Deeper Understanding of Skeleton-based Gait Recognition},
  publisher = {arXiv},
  year = {2022}
}