Skip to content

Commit

Permalink
update getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
yysijie committed Oct 11, 2019
1 parent bf68718 commit f298f43
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 1 deletion.
43 changes: 43 additions & 0 deletions configs/recognition/st_gcn/kinetics-skeleton-from-hrnet/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
argparse_cfg:
gpus:
bind_to: processor_cfg.gpus
help: number of gpus
batch_size:
bind_to: processor_cfg.batch_size
checkpoint:
bind_to: processor_cfg.checkpoint
help: the checkpoint file to load from
default: mmskeleton://st_gcn/kinetics-skeleton

processor_cfg:
type: "processor.recognition.test"
checkpoint:
workers: 32

# model setting
model_cfg:
type: "models.backbones.ST_GCN_18"
in_channels: 3
num_class: 400
edge_importance_weighting: True
graph_cfg:
layout: "openpose"
strategy: "spatial"

# dataset setting
dataset_cfg:
type: "datasets.DataPipeline"
data_source:
type: "datasets.SkeletonLoader"
data_dir: ./data/Kinetics/skeleton-from-openpose/val2014
num_track: 2
pipeline:
- type: "datasets.skeleton.normalize_by_resolution"
- type: "datasets.skeleton.mask_by_visibility"
- type: "datasets.skeleton.transpose"
order: [0, 2, 1, 3]
- type: "datasets.skeleton.to_tuple"

# dataloader setting
batch_size: 256
gpus: 4
92 changes: 92 additions & 0 deletions configs/recognition/st_gcn/kinetics-skeleton-from-hrnet/train.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
argparse_cfg:
gpus:
bind_to: processor_cfg.gpus
help: number of gpus
work_dir:
bind_to: processor_cfg.work_dir
help: the dir to save logs and models
default: ./work_dir/recognition/st_gcn/kinetics-skeleton-from-openpose
batch_size:
bind_to: processor_cfg.batch_size
resume_from:
bind_to: processor_cfg.resume_from
help: the checkpoint file to resume from



processor_cfg:
type: 'processor.recognition.train'

# model setting
model_cfg:
type: 'models.backbones.ST_GCN_18'
in_channels: 3
num_class: 400
edge_importance_weighting: True
graph_cfg:
layout: 'openpose'
strategy: 'spatial'
loss_cfg:
type: 'torch.nn.CrossEntropyLoss'

# dataset setting
dataset_cfg:
- type: "datasets.DataPipeline"
data_source:
type: "datasets.SkeletonLoader"
data_dir: ./data/Kinetics/skeleton-from-openpose/train2014
num_track: 2
pipeline:
- type: "datasets.skeleton.normalize_by_resolution"
- type: "datasets.skeleton.mask_by_visibility"
- type: "datasets.skeleton.temporal_repeat"
size: 150
- type: "datasets.skeleton.simulate_camera_moving"
- type: "datasets.skeleton.transpose"
order: [0, 2, 1, 3]
- type: "datasets.skeleton.to_tuple"

- type: "datasets.DataPipeline"
data_source:
type: "datasets.SkeletonLoader"
data_dir: ./data/Kinetics/skeleton-from-openpose/val2014
num_track: 2
pipeline:
- type: "datasets.skeleton.normalize_by_resolution"
- type: "datasets.skeleton.mask_by_visibility"
- type: "datasets.skeleton.transpose"
order: [0, 2, 1, 3]
- type: "datasets.skeleton.to_tuple"


# dataloader setting
batch_size: 256
gpus: 4

# optimizer setting
optimizer_cfg:
type: 'torch.optim.SGD'
lr: 0.1
momentum: 0.9
nesterov: true
weight_decay: 0.0001

# runtime setting
workflow: [['train', 5], ['val', 1]]
work_dir:
workers: 32
log_level: 0
total_epochs: 50
training_hooks:
lr_config:
policy: 'step'
step: [20, 30, 40, 50]
log_config:
interval: 100
hooks:
- type: TextLoggerHook
checkpoint_config:
interval: 5
optimizer_config:
resume_from:
load_from:
2 changes: 1 addition & 1 deletion configs/utils/build_kinetics_skeleton_from_hrnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ processor_cfg:
type: "processor.skeleton_dataset.build"
gpus: 1
worker_per_gpu: 2
video_dir: data/resized_videos_kinetics_val2014
video_dir: data/resized_340x256_videos_kinetics_val2014
out_dir: "data/kinetics_val2014"
category_annotation: data/category_annotation_kinetics_val2014.json

Expand Down
2 changes: 2 additions & 0 deletions doc/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ cd mmskeleton
python setup.py develop
```

Sometimes `mmdet` may be not installed successfully. In that case, please install [mmdet](https://github.com/open-mmlab/mmdetection/blob/master/docs/INSTALL.md) manually.

To **verify** that mmskeleton installed correctly, use:
```shell
python mmskl.py pose_demo [--gpus $GPUS]
Expand Down

0 comments on commit f298f43

Please sign in to comment.