Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add RandAugment_T to pipelines #2154

Open
wants to merge 1 commit into
base: 0.x
Choose a base branch
from

Conversation

sttaseen
Copy link

Motivation

While torchvision.transforms.RandAugment works effectively for spatial transformations, it does not cover any temporally varying transformations needed for video clips. T. Kim et al. proposed RandAug_T in their paper, Learning Temporally Invariant and Localizable Features via Data Augmentations, which is an extension of torchvision.transforms.RandAugment that, linearly interpolates a random transformation between two magnitudes from the first frame to the last frame in a video clip.

Modification

Added randaugment_utils.py under mmaction/datasets/pipelines.
Modified __init__.py and augmentations.py under mmaction/datasets/pipelines to add new data augmentation, RandAugment_T.

Use cases (Optional)

Sample Use:

train_pipeline = [
    dict(type='SampleFrames', clip_len=32, frame_interval=2, num_clips=1),
    dict(type='RawFrameDecode'),
    dict(type='Resize', scale=(224, 224), keep_ratio=False),
    dict(type='RandAugment_T'),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='FormatShape', input_format='NCTHW'),
    dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]),
    dict(type='ToTensor', keys=['imgs', 'label'])

Checklist

  1. Pre-commit or other linting tools should be used to fix the potential lint issues.
  2. The modification should be covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation should be modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ly015 ly015 requested a review from cir7 January 6, 2023 07:40
@ly015
Copy link
Member

ly015 commented Jan 6, 2023

Thank you very much for contributing to MMAction2. Could you please sign the CLA so we can accept your contribution?

And there seem to be lint issues in the code. Would you mind fixing them by with pre-commit hooks following our documentation?

@cir7 cir7 deleted the branch open-mmlab:0.x April 10, 2023 12:26
@cir7 cir7 closed this Apr 10, 2023
@cir7 cir7 reopened this Apr 10, 2023
@cir7 cir7 changed the base branch from master to 0.x April 10, 2023 13:22
@OpenMMLab-Assistant001
Copy link

Hi @sttaseen !We are grateful for your efforts in helping improve this open-source project during your personal time.

Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA
If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:)

Thank you again for your contribution❤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants