hassony2 / torch_videovision

Transforms for video datasets in pytorch
GNU General Public License v3.0
269 stars 44 forks source link

Bug in ColorJitter #8

Open Kennard123661 opened 4 years ago

Kennard123661 commented 4 years ago

https://github.com/hassony2/torch_videovision/blob/ae4b32b4dc76f97387ae74c9c652bffb7ba05697/torchvideotransforms/video_transforms.py#L322

Hi @hassony2 , I think there is a bug here where it should be

        for img in clip:
            for func in img_transforms:
                img = func(img)
            jittered_clip.append(img)
xmengli commented 4 years ago

@Kennard123661

I think you are correct. This is a bug in the code. Another way is:

jittered_clip = [] for img in clip: jittered_img = img.copy() for func in img_transforms: jittered_img = func(jittered_img) jittered_clip.append(jittered_img)

I think in this way, the color transformation will be applied for each clip independently.

LiUzHiAn commented 3 years ago

@Kennard123661 , @xmengli999 ,

I agree with you guys, let me make a PR, check it out here :)

SmallXieGithub commented 1 year ago

Hi, I have a question. Should I use ColorJitter for non-RGB modalities?

Ghelman-A commented 1 year ago

Hi, I have a question. Should I use ColorJitter for non-RGB modalities?

Hey! I think some papers have used it with the optical flow and temporal gradient modalities as well:

  1. http://openaccess.thecvf.com/content/CVPR2022/html/Xiao_Learning_From_Temporal_Gradient_for_Semi-Supervised_Action_Recognition_CVPR_2022_paper.html
  2. https://openaccess.thecvf.com/content/ICCV2021/html/Xiong_Multiview_Pseudo-Labeling_for_Semi-Supervised_Learning_From_Video_ICCV_2021_paper.html