Skip to content

Commit

Permalink
convert kinetic-skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
yysijie committed Mar 20, 2018
1 parent 6737083 commit 76ab6dc
Show file tree
Hide file tree
Showing 23 changed files with 302 additions and 144 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ where the ```<path to nturgbd>``` points to the 3D skeletons modality of NTU RGB
### Kinetics-skeleton
[Kinetics](https://deepmind.com/research/open-source/open-source-datasets/kinetics/) is a video-based dataset for action recognition which only provide raw video clips without skeleton data. To obatin the joint locations, we first resized all videos to the resolution of 340x256 and converted the frame rate to 30 fps. Then, we extracted skeletons from each frame in Kinetics by [Openpose](https://github.com/CMU-Perceptual-Computing-Lab/openpose). The extracted skeleton data we called **Kinetics-skeleton**(7.5GB) can be directly downloaded from [GoogleDrive](https://drive.google.com/open?id=1SPQ6FmFsjGg3f59uCWfdUWI-5HJM_YhZ) or [BaiduYun](https://pan.baidu.com/s/1dwKG2TLvG-R1qeIiE4MjeA#list/path=%2FShare%2FAAAI18%2Fkinetics-skeleton&parentPath=%2FShare).

It is highly recommended storing data in the **SSD** rather than HDD for efficiency.

After uncompressing, rebuild the database by this command:
```
python tools/kinetics_gendata.py --data_path <path to kinetics-skeleton>
```

## Testing Pretrained Models
### Get trained models
Expand Down
25 changes: 25 additions & 0 deletions config/baseline/kinetics-skeleton-from-rawdata/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# feeder
# read data from original kenetics-skeleton dataset
feeder: st_gcn.feeder.Feeder_kinetics
test_feeder_args:
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_val
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_val_label.json


# model
model: st_gcn.net.TCN
model_args:
num_class: 400
channel: 108
window_size: 300
use_data_bn: True


# test
phase: test
device: 0
test_batch_size: 64
weights: ./model/kinetics-tcn.pt



35 changes: 35 additions & 0 deletions config/baseline/kinetics-skeleton-from-rawdata/train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
work_dir: ./work_dir/Kinetics/TCN

# feeder
# read data from original kenetics-skeleton dataset
feeder: st_gcn.feeder.Feeder_kinetics
train_feeder_args:
random_move: True
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_train
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_train_label.json
test_feeder_args:
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_val
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_val_label.json


# model
model: st_gcn.net.TCN
model_args:
num_class: 400
channel: 108
window_size: 300
use_data_bn: True

#optim
weight_decay: 0.0001
base_lr: 0.1
step: [10, 60]

# training
device: [0,1,2,3]
batch_size: 512
test_batch_size: 512
num_epoch: 60
nesterov: True


8 changes: 3 additions & 5 deletions config/baseline/kinetics-skeleton/test.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# feeder
feeder: st_gcn.feeder.Feeder_kinetics
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/kinetics-skeleton/kinetics_val
label_path : ./data/kinetics-skeleton/kinetics_val_label.json
data_path: ./data/Kinetics/kinetics-skeleton/val_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/val_label.pkl


# model
Expand Down
18 changes: 6 additions & 12 deletions config/baseline/kinetics-skeleton/train.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
work_dir: ./work_dir/Kinetics/TCN-p2
work_dir: ./work_dir/Kinetics/TCN

# feeder
feeder: st_gcn.feeder.Feeder_kinetics
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
random_choose: True
random_move: True
window_size: 300
data_path: ./data/kinetics-skeleton/kinetics_train
label_path : ./data/kinetics-skeleton/kinetics_train_label.json
data_path: ./data/Kinetics/kinetics-skeleton/train_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/train_label.pkl
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/kinetics-skeleton/kinetics_val
label_path : ./data/kinetics-skeleton/kinetics_val_label.json

data_path: ./data/Kinetics/kinetics-skeleton/val_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/val_label.pkl

# model
model: st_gcn.net.TCN
Expand Down
2 changes: 0 additions & 2 deletions config/baseline/nturgbd-cross-subject/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# feeder
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/val_data.npy
label_path: ./data/NTU-RGB-D/xsub/val_label.pkl

Expand Down
4 changes: 0 additions & 4 deletions config/baseline/nturgbd-cross-subject/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ work_dir: ./work_dir/NTU-RGB-D/xsub/TCN
# feeder
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/train_data.npy
label_path: ./data/NTU-RGB-D/xsub/train_label.pkl
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/val_data.npy
label_path: ./data/NTU-RGB-D/xsub/val_label.pkl

Expand Down
2 changes: 0 additions & 2 deletions config/baseline/nturgbd-cross-view/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# feeder
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xview/val_data.npy
label_path: ./data/NTU-RGB-D/xview/val_label.pkl

Expand Down
4 changes: 0 additions & 4 deletions config/baseline/nturgbd-cross-view/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ work_dir: ./work_dir/NTU-RGB-D/xview/TCN
# feeder
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
window_size: 300
data_path: ./data/NTU-RGB-D/xview/train_data.npy
label_path: ./data/NTU-RGB-D/xview/train_label.pkl
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xview/val_data.npy
label_path: ./data/NTU-RGB-D/xview/val_label.pkl

Expand Down
31 changes: 31 additions & 0 deletions config/st_gcn/kinetics-skeleton-from-rawdata/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# feeder
# read data from original kenetics-skeleton dataset
feeder: st_gcn.feeder.Feeder_kinetics
test_feeder_args:
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_val
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_val_label.json

# model
model: st_gcn.net.ST_GCN
model_args:
num_class: 400
channel: 3
window_size: 150
num_person: 2
num_point: 18
dropout: 0
graph: st_gcn.graph.Kinetics
graph_args:
labeling_mode: 'spatial'
mask_learning: True
use_data_bn: True


# test
phase: test
device: 0
test_batch_size: 64
weights: ./model/kinetics-st_gcn.pt



45 changes: 45 additions & 0 deletions config/st_gcn/kinetics-skeleton-from-rawdata/train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
work_dir: ./work_dir/Kinetics/ST_GCN

# feeder
# read data from original kenetics-skeleton dataset
feeder: st_gcn.feeder.Feeder_kinetics
train_feeder_args:
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_train
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_train_label.json
random_choose: True
random_move: True
window_size: 150
test_feeder_args:
data_path: ./data/Kinetics/kinetics-skeleton/kinetics_val
label_path : ./data/Kinetics/kinetics-skeleton/kinetics_val_label.json

# model
model: st_gcn.net.ST_GCN
model_args:
num_class: 400
channel: 3
window_size: 150
num_person: 2
num_point: 18
dropout: 0
graph: st_gcn.graph.Kinetics
graph_args:
labeling_mode: 'spatial'
mask_learning: True
use_data_bn: True

#optim
weight_decay: 0.0001
base_lr: 0.1
step: [20, 30, 40, 50]

# training
device: [0,1,2,3]
batch_size: 256
test_batch_size: 256
num_epoch: 60
nesterov: True
save_interval: 10



9 changes: 4 additions & 5 deletions config/st_gcn/kinetics-skeleton/test.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# feeder
feeder: st_gcn.feeder.Feeder_kinetics
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
data_path: ./data/kinetics-skeleton/kinetics_val
label_path : ./data/kinetics-skeleton/kinetics_val_label.json
window_size: 150
data_path: ./data/Kinetics/kinetics-skeleton/val_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/val_label.pkl


# model
model: st_gcn.net.ST_GCN
Expand Down
13 changes: 5 additions & 8 deletions config/st_gcn/kinetics-skeleton/train.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
work_dir: ./work_dir/Kinetics/ST_GCN

# feeder
feeder: st_gcn.feeder.Feeder_kinetics
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
data_path: ./data/kinetics-skeleton/kinetics_train
label_path : ./data/kinetics-skeleton/kinetics_train_label.json
random_choose: True
random_move: True
window_size: 150
data_path: ./data/Kinetics/kinetics-skeleton/train_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/train_label.pkl
test_feeder_args:
mode: test
data_path: ./data/kinetics-skeleton/kinetics_val
label_path : ./data/kinetics-skeleton/kinetics_val_label.json
window_size: 150
data_path: ./data/Kinetics/kinetics-skeleton/val_data.npy
label_path: ./data/Kinetics/kinetics-skeleton/val_label.pkl

# model
model: st_gcn.net.ST_GCN
Expand Down
2 changes: 0 additions & 2 deletions config/st_gcn/nturgbd-cross-subject/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# feeder
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/val_data.npy
label_path: ./data/NTU-RGB-D/xsub/val_label.pkl

Expand Down
4 changes: 0 additions & 4 deletions config/st_gcn/nturgbd-cross-subject/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ work_dir: ./work_dir/NTU-RGB-D/xsub/ST_GCN
# feeder
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/train_data.npy
label_path: ./data/NTU-RGB-D/xsub/train_label.pkl
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xsub/val_data.npy
label_path: ./data/NTU-RGB-D/xsub/val_label.pkl

Expand Down
2 changes: 0 additions & 2 deletions config/st_gcn/nturgbd-cross-view/test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# feeder
feeder: st_gcn.feeder.Feeder
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xview/val_data.npy
label_path: ./data/NTU-RGB-D/xview/val_label.pkl

Expand Down
4 changes: 0 additions & 4 deletions config/st_gcn/nturgbd-cross-view/train.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ work_dir: ./work_dir/NTU-RGB-D/xview/ST_GCN
# feeder
feeder: st_gcn.feeder.Feeder
train_feeder_args:
mode: train
window_size: 300
data_path: ./data/NTU-RGB-D/xview/train_data.npy
label_path: ./data/NTU-RGB-D/xview/train_label.pkl
test_feeder_args:
mode: test
window_size: 300
data_path: ./data/NTU-RGB-D/xview/val_data.npy
label_path: ./data/NTU-RGB-D/xview/val_label.pkl

Expand Down
Loading

0 comments on commit 76ab6dc

Please sign in to comment.