-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Showing
7 changed files
with
340 additions
and
10 deletions.
There are no files selected for viewing
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
110 changes: 110 additions & 0 deletions
110
configs/localization/bmn/bmn_2xb8-2048x100-9e_activitynet-slowonly-k700-feature.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,110 @@ | ||
_base_ = [ | ||
'../../_base_/models/bmn_400x100.py', '../../_base_/default_runtime.py' | ||
] | ||
|
||
model = dict(feat_dim=2048) | ||
|
||
# dataset settings | ||
dataset_type = 'ActivityNetDataset' | ||
data_root = 'data/ActivityNet/k700slowonly' | ||
data_root_val = 'data/ActivityNet/k700slowonly' | ||
ann_file_train = 'data/ActivityNet/anet_anno_train.json' | ||
ann_file_val = 'data/ActivityNet/anet_anno_val.json' | ||
ann_file_test = 'data/ActivityNet/anet_anno_val.json' | ||
|
||
train_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict(type='GenerateLocalizationLabels'), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('gt_bbox', ), | ||
meta_keys=('video_name', )) | ||
] | ||
|
||
val_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict(type='GenerateLocalizationLabels'), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('gt_bbox', ), | ||
meta_keys=('video_name', 'duration_second', 'duration_frame', | ||
'annotations', 'feature_frame')) | ||
] | ||
|
||
test_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('gt_bbox', ), | ||
meta_keys=('video_name', 'duration_second', 'duration_frame', | ||
'annotations', 'feature_frame')) | ||
] | ||
|
||
train_dataloader = dict( | ||
batch_size=8, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
drop_last=True, | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=dict(video=data_root), | ||
pipeline=train_pipeline)) | ||
|
||
val_dataloader = dict( | ||
batch_size=1, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=val_pipeline, | ||
test_mode=True)) | ||
|
||
test_dataloader = dict( | ||
batch_size=1, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=test_pipeline, | ||
test_mode=True)) | ||
|
||
max_epochs = 9 | ||
train_cfg = dict( | ||
type='EpochBasedTrainLoop', | ||
max_epochs=max_epochs, | ||
val_begin=1, | ||
val_interval=1) | ||
|
||
val_cfg = dict(type='ValLoop') | ||
test_cfg = dict(type='TestLoop') | ||
|
||
optim_wrapper = dict( | ||
optimizer=dict(type='Adam', lr=0.001, weight_decay=0.0001), | ||
clip_grad=dict(max_norm=40, norm_type=2)) | ||
|
||
param_scheduler = [ | ||
dict( | ||
type='MultiStepLR', | ||
begin=0, | ||
end=max_epochs, | ||
by_epoch=True, | ||
milestones=[ | ||
7, | ||
], | ||
gamma=0.1) | ||
] | ||
|
||
work_dir = './work_dirs/bmn_400x100_2x8_9e_activitynet_feature/' | ||
test_evaluator = dict( | ||
type='ANetMetric', | ||
metric_type='AR@AN', | ||
dump_config=dict(out=f'{work_dir}/results.json', output_format='json')) | ||
val_evaluator = test_evaluator |
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
84 changes: 84 additions & 0 deletions
84
configs/localization/bsn/bsn_pem_1xb16-2048x100-20e_activitynet-slowonly-k700-feature.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,84 @@ | ||
_base_ = [ | ||
'../../_base_/models/bsn_pem.py', '../../_base_/schedules/adam_20e.py', | ||
'../../_base_/default_runtime.py' | ||
] | ||
|
||
# dataset settings | ||
dataset_type = 'ActivityNetDataset' | ||
data_root = 'data/ActivityNet/k700slowonly' | ||
data_root_val = 'data/ActivityNet/k700slowonly' | ||
ann_file_train = 'data/ActivityNet/anet_anno_train.json' | ||
ann_file_val = 'data/ActivityNet/anet_anno_val.json' | ||
ann_file_test = 'data/ActivityNet/anet_anno_val.json' | ||
|
||
work_dir = 'work_dirs/bsn_400x100_20e_1x16_activitynet_feature/' | ||
pgm_proposals_dir = f'{work_dir}/pgm_proposals/' | ||
pgm_features_dir = f'{work_dir}/pgm_features/' | ||
|
||
train_pipeline = [ | ||
dict( | ||
type='LoadProposals', | ||
top_k=500, | ||
pgm_proposals_dir=pgm_proposals_dir, | ||
pgm_features_dir=pgm_features_dir), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('reference_temporal_iou', 'bsp_feature'), | ||
meta_keys=()) | ||
] | ||
val_pipeline = [ | ||
dict( | ||
type='LoadProposals', | ||
top_k=1000, | ||
pgm_proposals_dir=pgm_proposals_dir, | ||
pgm_features_dir=pgm_features_dir), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('tmin', 'tmax', 'tmin_score', 'tmax_score', 'bsp_feature'), | ||
meta_keys=('video_name', 'duration_second', 'duration_frame', | ||
'annotations', 'feature_frame')), | ||
] | ||
test_pipeline = val_pipeline | ||
|
||
train_dataloader = dict( | ||
batch_size=16, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=dict(video=data_root), | ||
pipeline=train_pipeline)) | ||
|
||
val_dataloader = dict( | ||
batch_size=1, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=val_pipeline, | ||
test_mode=True)) | ||
|
||
test_dataloader = dict( | ||
batch_size=1, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=test_pipeline, | ||
test_mode=True)) | ||
|
||
train_cfg = dict(val_interval=20) | ||
|
||
test_evaluator = dict( | ||
type='ANetMetric', | ||
metric_type='AR@AN', | ||
dump_config=dict(out=f'{work_dir}/results.json', output_format='json')) | ||
val_evaluator = test_evaluator |
32 changes: 32 additions & 0 deletions
32
configs/localization/bsn/bsn_pgm_2048x100_activitynet-slowonly-k700-feature.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,32 @@ | ||
# dataset settings | ||
dataset_type = 'ActivityNetDataset' | ||
data_root = 'data/ActivityNet/k700slowonly' | ||
data_root_val = 'data/ActivityNet/k700slowonly' | ||
ann_file_train = 'data/ActivityNet/anet_anno_train.json' | ||
ann_file_val = 'data/ActivityNet/anet_anno_val.json' | ||
ann_file_test = 'data/ActivityNet/anet_anno_test.json' | ||
|
||
work_dir = 'work_dirs/bsn_400x100_20e_1x16_activitynet_feature/' | ||
tem_results_dir = f'{work_dir}/tem_results/' | ||
pgm_proposals_dir = f'{work_dir}/pgm_proposals/' | ||
pgm_features_dir = f'{work_dir}/pgm_features/' | ||
|
||
temporal_scale = 100 | ||
pgm_proposals_cfg = dict( | ||
pgm_proposals_thread=8, temporal_scale=temporal_scale, peak_threshold=0.5) | ||
pgm_features_test_cfg = dict( | ||
pgm_features_thread=32, | ||
top_k=1000, | ||
num_sample_start=8, | ||
num_sample_end=8, | ||
num_sample_action=16, | ||
num_sample_interp=3, | ||
bsp_boundary_ratio=0.2) | ||
pgm_features_train_cfg = dict( | ||
pgm_features_thread=32, | ||
top_k=500, | ||
num_sample_start=8, | ||
num_sample_end=8, | ||
num_sample_action=16, | ||
num_sample_interp=3, | ||
bsp_boundary_ratio=0.2) |
95 changes: 95 additions & 0 deletions
95
configs/localization/bsn/bsn_tem_1xb16-2048x100-20e_activitynet-k700-feature.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,95 @@ | ||
_base_ = ['../../_base_/models/bsn_tem.py', '../../_base_/default_runtime.py'] | ||
|
||
model = dict(tem_feat_dim=2048) | ||
|
||
# dataset settings | ||
dataset_type = 'ActivityNetDataset' | ||
data_root = 'data/ActivityNet/k700slowonly' | ||
data_root_val = 'data/ActivityNet/k700slowonly' | ||
ann_file_train = 'data/ActivityNet/anet_anno_train.json' | ||
ann_file_val = 'data/ActivityNet/anet_anno_val.json' | ||
ann_file_test = 'data/ActivityNet/anet_anno_trainval.json' | ||
|
||
train_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict(type='GenerateLocalizationLabels'), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('gt_bbox', ), | ||
meta_keys=('video_name', )) | ||
] | ||
val_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict(type='GenerateLocalizationLabels'), | ||
dict( | ||
type='PackLocalizationInputs', | ||
keys=('gt_bbox', ), | ||
meta_keys=('video_name', )) | ||
] | ||
test_pipeline = [ | ||
dict(type='LoadLocalizationFeature'), | ||
dict(type='PackLocalizationInputs', meta_keys=('video_name', )) | ||
] | ||
|
||
train_dataloader = dict( | ||
batch_size=16, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=True), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_train, | ||
data_prefix=dict(video=data_root), | ||
pipeline=train_pipeline)) | ||
val_dataloader = dict( | ||
batch_size=16, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_val, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=val_pipeline, | ||
test_mode=True)) | ||
test_dataloader = dict( | ||
batch_size=1, | ||
num_workers=8, | ||
persistent_workers=True, | ||
sampler=dict(type='DefaultSampler', shuffle=False), | ||
dataset=dict( | ||
type=dataset_type, | ||
ann_file=ann_file_test, | ||
data_prefix=dict(video=data_root_val), | ||
pipeline=test_pipeline, | ||
test_mode=True)) | ||
|
||
train_cfg = dict( | ||
type='EpochBasedTrainLoop', max_epochs=20, val_begin=1, val_interval=20) | ||
val_cfg = dict(type='ValLoop') | ||
test_cfg = dict(type='TestLoop') | ||
|
||
optim_wrapper = dict( | ||
optimizer=dict(type='Adam', lr=0.001, weight_decay=0.0001), | ||
clip_grad=dict(max_norm=40, norm_type=2)) | ||
|
||
param_scheduler = [ | ||
dict( | ||
type='MultiStepLR', | ||
begin=0, | ||
end=20, | ||
by_epoch=True, | ||
milestones=[7, 14], | ||
gamma=0.1) | ||
] | ||
|
||
work_dir = 'work_dirs/bsn_400x100_20e_1x16_activitynet_feature/' | ||
tem_results_dir = f'{work_dir}/tem_results/' | ||
|
||
test_evaluator = dict( | ||
type='ANetMetric', | ||
metric_type='TEM', | ||
dump_config=dict(out=tem_results_dir, output_format='csv')) | ||
val_evaluator = test_evaluator | ||
|
||
default_hooks = dict(checkpoint=dict(filename_tmpl='tem_epoch_{}.pth')) |
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