Skip to content

Commit

Permalink
Augmentation comparison for video action recognition (#1266)
Browse files Browse the repository at this point in the history
* diff aug

* add augv2

* add more aug

* done all aug style

* fix comments

* tupo
  • Loading branch information
bryanyzhu committed Apr 23, 2020
1 parent 447c8e8 commit 8dceceb
Show file tree
Hide file tree
Showing 10 changed files with 550 additions and 141 deletions.
5 changes: 4 additions & 1 deletion gluoncv/data/hmdb51/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class HMDB51(VideoClsCustom):
The temporal stride for sparse sampling of video frames in slow branch of a SlowFast network.
fast_temporal_stride : int, default 2.
The temporal stride for sparse sampling of video frames in fast branch of a SlowFast network.
data_aug : str, default 'v1'.
Different types of data augmentation pipelines. Supports v1, v2, v3 and v4.
lazy_init : bool, default False.
If set to True, build a dataset instance without loading any dataset.
"""
Expand All @@ -98,6 +100,7 @@ def __init__(self,
slowfast=False,
slow_temporal_stride=16,
fast_temporal_stride=2,
data_aug='v1',
lazy_init=False,
transform=None):

Expand All @@ -106,7 +109,7 @@ def __init__(self,
num_crop, new_length, new_step, new_width, new_height,
target_width, target_height, temporal_jitter,
video_loader, use_decord, slowfast, slow_temporal_stride,
fast_temporal_stride, lazy_init, transform)
fast_temporal_stride, data_aug, lazy_init, transform)

class HMDB51Attr(object):
def __init__(self):
Expand Down
5 changes: 4 additions & 1 deletion gluoncv/data/kinetics400/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class Kinetics400(VideoClsCustom):
The temporal stride for sparse sampling of video frames in slow branch of a SlowFast network.
fast_temporal_stride : int, default 2.
The temporal stride for sparse sampling of video frames in fast branch of a SlowFast network.
data_aug : str, default 'v1'.
Different types of data augmentation pipelines. Supports v1, v2, v3 and v4.
lazy_init : bool, default False.
If set to True, build a dataset instance without loading any dataset.
"""
Expand All @@ -97,6 +99,7 @@ def __init__(self,
slowfast=False,
slow_temporal_stride=16,
fast_temporal_stride=2,
data_aug='v1',
lazy_init=False,
transform=None):

Expand All @@ -105,7 +108,7 @@ def __init__(self,
num_crop, new_length, new_step, new_width, new_height,
target_width, target_height, temporal_jitter,
video_loader, use_decord, slowfast, slow_temporal_stride,
fast_temporal_stride, lazy_init, transform)
fast_temporal_stride, data_aug, lazy_init, transform)

class Kinetics400Attr(object):
def __init__(self):
Expand Down
5 changes: 4 additions & 1 deletion gluoncv/data/somethingsomethingv2/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class SomethingSomethingV2(VideoClsCustom):
The temporal stride for sparse sampling of video frames in slow branch of a SlowFast network.
fast_temporal_stride : int, default 2.
The temporal stride for sparse sampling of video frames in fast branch of a SlowFast network.
data_aug : str, default 'v1'.
Different types of data augmentation pipelines. Supports v1, v2, v3 and v4.
lazy_init : bool, default False.
If set to True, build a dataset instance without loading any dataset.
"""
Expand All @@ -97,6 +99,7 @@ def __init__(self,
slowfast=False,
slow_temporal_stride=16,
fast_temporal_stride=2,
data_aug='v1',
lazy_init=False,
transform=None):

Expand All @@ -105,7 +108,7 @@ def __init__(self,
num_crop, new_length, new_step, new_width, new_height,
target_width, target_height, temporal_jitter,
video_loader, use_decord, slowfast, slow_temporal_stride,
fast_temporal_stride, lazy_init, transform)
fast_temporal_stride, data_aug, lazy_init, transform)

class SomethingSomethingV2Attr(object):
def __init__(self):
Expand Down

1 comment on commit 8dceceb

@guangyangai
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data_aug option is not in gluoncv 0.7.0? Get an init error when trying to add data_aug option

Please sign in to comment.