forked from open-mmlab/mmaction2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Naoki-Wake
committed
Mar 30, 2021
1 parent
bc49910
commit 5fa7071
Showing
32 changed files
with
2,166 additions
and
16 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
92 changes: 92 additions & 0 deletions
92
configs/recognition/arr_tsm/tsm_mobilenetv2_1x1x8_50e_kinetics400_rgb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
_base_ = [ | ||
'../../_base_/models/tsm_mobilenet_v2.py', | ||
'../../_base_/schedules/sgd_tsm_mobilenet_v2_50e.py', | ||
'../../_base_/default_runtime.py' | ||
] | ||
|
||
# dataset settings | ||
dataset_type = 'RawframeDataset' | ||
data_root = 'data/kinetics400/rawframes_train' | ||
data_root_val = 'data/kinetics400/rawframes_val' | ||
ann_file_train = 'data/kinetics400/kinetics400_train_list_rawframes.txt' | ||
ann_file_val = 'data/kinetics400/kinetics400_val_list_rawframes.txt' | ||
ann_file_test = 'data/kinetics400/kinetics400_val_list_rawframes.txt' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False) | ||
train_pipeline = [ | ||
dict(type='SampleFrames', clip_len=1, frame_interval=1, num_clips=8), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict( | ||
type='MultiScaleCrop', | ||
input_size=224, | ||
scales=(1, 0.875, 0.75, 0.66), | ||
random_crop=False, | ||
max_wh_scale_gap=1, | ||
num_fixed_crops=13), | ||
dict(type='Resize', scale=(224, 224), keep_ratio=False), | ||
dict(type='Flip', flip_ratio=0.5), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs', 'label']) | ||
] | ||
val_pipeline = [ | ||
dict( | ||
type='SampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='CenterCrop', crop_size=224), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
test_pipeline = [ | ||
dict( | ||
type='SampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='ThreeCrop', crop_size=256), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
data = dict( | ||
videos_per_gpu=8, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=data_root, | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=data_root_val, | ||
pipeline=val_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=data_root_val, | ||
pipeline=test_pipeline)) | ||
evaluation = dict( | ||
interval=5, metrics=['top_k_accuracy', 'mean_class_accuracy']) | ||
|
||
# optimizer | ||
optimizer = dict( | ||
lr=0.01, # this lr is used for 8 gpus | ||
) | ||
|
||
# runtime settings | ||
checkpoint_config = dict(interval=1) | ||
work_dir = './work_dirs/tsm_mobilenetv2_dense_1x1x8_100e_kinetics400_rgb/' |
97 changes: 97 additions & 0 deletions
97
configs/recognition/arr_tsm/tsm_mobilenetv2_video_dense_1x1x8_100e_kinetics400_rgb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
_base_ = [ | ||
'../../_base_/models/tsm_mobilenet_v2.py', | ||
'../../_base_/schedules/sgd_tsm_mobilenet_v2_100e.py', | ||
'../../_base_/default_runtime.py' | ||
] | ||
|
||
# dataset settings | ||
dataset_type = 'VideoDataset' | ||
data_root = 'data/kinetics400/videos_train' | ||
data_root_val = 'data/kinetics400/videos_val' | ||
ann_file_train = 'data/kinetics400/kinetics400_train_list_videos.txt' | ||
ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt' | ||
ann_file_test = 'data/kinetics400/kinetics400_val_list_videos.txt' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False) | ||
train_pipeline = [ | ||
dict(type='DecordInit'), | ||
dict(type='DenseSampleFrames', clip_len=1, frame_interval=1, num_clips=8), | ||
dict(type='DecordDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict( | ||
type='MultiScaleCrop', | ||
input_size=224, | ||
scales=(1, 0.875, 0.75, 0.66), | ||
random_crop=False, | ||
max_wh_scale_gap=1, | ||
num_fixed_crops=13), | ||
dict(type='Resize', scale=(224, 224), keep_ratio=False), | ||
dict(type='Flip', flip_ratio=0.5), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs', 'label']) | ||
] | ||
val_pipeline = [ | ||
dict(type='DecordInit'), | ||
dict( | ||
type='DenseSampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='DecordDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='CenterCrop', crop_size=224), | ||
dict(type='Flip', flip_ratio=0), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
test_pipeline = [ | ||
dict(type='DecordInit'), | ||
dict( | ||
type='DenseSampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='DecordDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='ThreeCrop', crop_size=256), | ||
dict(type='Flip', flip_ratio=0), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
data = dict( | ||
videos_per_gpu=8, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=data_root, | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=data_root_val, | ||
pipeline=val_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=data_root_val, | ||
pipeline=test_pipeline)) | ||
evaluation = dict( | ||
interval=5, metrics=['top_k_accuracy', 'mean_class_accuracy']) | ||
|
||
# optimizer | ||
optimizer = dict( | ||
lr=0.01, # this lr is used for 8 gpus | ||
) | ||
|
||
# runtime settings | ||
checkpoint_config = dict(interval=5) | ||
work_dir = './work_dirs/tsm_mobilenetv2_dense_video_1x1x8_100e_kinetics400_rgb/' # noqa |
34 changes: 34 additions & 0 deletions
34
...s/recognition/arr_tsm/tsm_mobilenetv2_video_inference_dense_1x1x8_100e_kinetics400_rgb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
_base_ = ['../../_base_/models/tsm_mobilenet_v2.py'] | ||
|
||
# dataset settings | ||
dataset_type = 'VideoDataset' | ||
data_root_val = 'data/kinetics400/videos_val' | ||
ann_file_test = 'data/kinetics400/kinetics400_val_list_videos.txt' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False) | ||
test_pipeline = [ | ||
dict(type='DecordInit'), | ||
dict( | ||
type='DenseSampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='DecordDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='CenterCrop', crop_size=224), | ||
dict(type='Flip', flip_ratio=0), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
|
||
data = dict( | ||
videos_per_gpu=4, | ||
workers_per_gpu=4, | ||
test=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=data_root_val, | ||
pipeline=test_pipeline)) |
97 changes: 97 additions & 0 deletions
97
configs/recognition/arr_tsm/tsm_nl_dot_product_r50_1x1x8_50e_kinetics400_rgb.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
_base_ = [ | ||
'../../_base_/models/tsm_r50.py', '../../_base_/schedules/sgd_tsm_50e.py', | ||
'../../_base_/default_runtime.py' | ||
] | ||
|
||
# model settings | ||
model = dict( | ||
backbone=dict( | ||
non_local=((0, 0, 0), (1, 0, 1, 0), (1, 0, 1, 0, 1, 0), (0, 0, 0)), | ||
non_local_cfg=dict( | ||
sub_sample=True, | ||
use_scale=False, | ||
norm_cfg=dict(type='BN3d', requires_grad=True), | ||
mode='dot_product'))) | ||
|
||
# dataset settings | ||
dataset_type = 'RawframeDataset' | ||
data_root = 'data/kinetics400/rawframes_train' | ||
data_root_val = 'data/kinetics400/rawframes_val' | ||
ann_file_train = 'data/kinetics400/kinetics400_train_list_rawframes.txt' | ||
ann_file_val = 'data/kinetics400/kinetics400_val_list_rawframes.txt' | ||
ann_file_test = 'data/kinetics400/kinetics400_val_list_rawframes.txt' | ||
img_norm_cfg = dict( | ||
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False) | ||
train_pipeline = [ | ||
dict(type='SampleFrames', clip_len=1, frame_interval=1, num_clips=8), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict( | ||
type='MultiScaleCrop', | ||
input_size=224, | ||
scales=(1, 0.875, 0.75, 0.66), | ||
random_crop=False, | ||
max_wh_scale_gap=1, | ||
num_fixed_crops=13), | ||
dict(type='Resize', scale=(224, 224), keep_ratio=False), | ||
dict(type='Flip', flip_ratio=0.5), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs', 'label']) | ||
] | ||
val_pipeline = [ | ||
dict( | ||
type='SampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='CenterCrop', crop_size=224), | ||
dict(type='Flip', flip_ratio=0), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
test_pipeline = [ | ||
dict( | ||
type='SampleFrames', | ||
clip_len=1, | ||
frame_interval=1, | ||
num_clips=8, | ||
test_mode=True), | ||
dict(type='RawFrameDecode'), | ||
dict(type='Resize', scale=(-1, 256)), | ||
dict(type='CenterCrop', crop_size=224), | ||
dict(type='Flip', flip_ratio=0), | ||
dict(type='Normalize', **img_norm_cfg), | ||
dict(type='FormatShape', input_format='NCHW'), | ||
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), | ||
dict(type='ToTensor', keys=['imgs']) | ||
] | ||
data = dict( | ||
videos_per_gpu=8, | ||
workers_per_gpu=4, | ||
train=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=data_root, | ||
pipeline=train_pipeline), | ||
val=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=data_root_val, | ||
pipeline=val_pipeline), | ||
test=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=data_root_val, | ||
pipeline=test_pipeline)) | ||
evaluation = dict( | ||
interval=5, metrics=['top_k_accuracy', 'mean_class_accuracy']) | ||
|
||
# runtime settings | ||
work_dir = './work_dirs/tsm_nl_gaussian_r50_1x1x8_50e_kinetics400_rgb/' |
Oops, something went wrong.