File size: 2,321 Bytes
bbde80b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# Skeleton-based Action Recognition
## Data
The NTURGB+D 2D detection results are provided by [pyskl](https://github.com/kennymckormick/pyskl/blob/main/tools/data/README.md) using HRNet.
1. Download [`ntu60_hrnet.pkl`](https://download.openmmlab.com/mmaction/pyskl/data/nturgbd/ntu60_hrnet.pkl) and [`ntu120_hrnet.pkl`](https://download.openmmlab.com/mmaction/pyskl/data/nturgbd/ntu120_hrnet.pkl) to `data/action/`.
2. Download the 1-shot split [here](https://1drv.ms/f/s!AvAdh0LSjEOlfi-hqlHxdVMZxWM) and put it to `data/action/`.
## Running
### NTURGB+D
**Train from scratch:**
```shell
# Cross-subject
python train_action.py \
--config configs/action/MB_train_NTU60_xsub.yaml \
--checkpoint checkpoint/action/MB_train_NTU60_xsub
# Cross-view
python train_action.py \
--config configs/action/MB_train_NTU60_xview.yaml \
--checkpoint checkpoint/action/MB_train_NTU60_xview
```
**Finetune from pretrained MotionBERT:**
```shell
# Cross-subject
python train_action.py \
--config configs/action/MB_ft_NTU60_xsub.yaml \
--pretrained checkpoint/pretrain/MB_release \
--checkpoint checkpoint/action/FT_MB_release_MB_ft_NTU60_xsub
# Cross-view
python train_action.py \
--config configs/action/MB_ft_NTU60_xview.yaml \
--pretrained checkpoint/pretrain/MB_release \
--checkpoint checkpoint/action/FT_MB_release_MB_ft_NTU60_xview
```
**Evaluate:**
```bash
# Cross-subject
python train_action.py \
--config configs/action/MB_train_NTU60_xsub.yaml \
--evaluate checkpoint/action/MB_train_NTU60_xsub/best_epoch.bin
# Cross-view
python train_action.py \
--config configs/action/MB_train_NTU60_xview.yaml \
--evaluate checkpoint/action/MB_train_NTU60_xview/best_epoch.bin
```
### NTURGB+D-120 (1-shot)
**Train from scratch:**
```bash
python train_action_1shot.py \
--config configs/action/MB_train_NTU120_oneshot.yaml \
--checkpoint checkpoint/action/MB_train_NTU120_oneshot
```
**Finetune from a pretrained model:**
```bash
python train_action_1shot.py \
--config configs/action/MB_ft_NTU120_oneshot.yaml \
--pretrained checkpoint/pretrain/MB_release \
--checkpoint checkpoint/action/FT_MB_release_MB_ft_NTU120_oneshot
```
**Evaluate:**
```bash
python train_action_1shot.py \
--config configs/action/MB_train_NTU120_oneshot.yaml \
--evaluate checkpoint/action/MB_train_NTU120_oneshot/best_epoch.bin
```
|