class_docstr: Video Pre-processing
  
  args:
      grayscale: convert images to grayscale
      normalize: normalize videos
      resize: resize videos
      resize_size: output image size for resize
      norm_mean: normalize mean
      norm_std: normalize std
code: def __init__(
      self,
      grayscale,
      normalize,
      resize,
      resize_size,
      norm_mean,
      norm_std,
  ):
      super().__init__()
  
      # Params
      self.grayscale = grayscale
      self.normalize = normalize
      self.resize = resize
      self.resize_size = resize_size
      self.norm_mean = norm_mean
      self.norm_std = norm_std
  
      self.transforms = nn.ModuleList()
  
      # Convert float32 [0:255] -> [0:1]
      if TORCHVISION_AVAILABLE:
          self.transforms.append(
              torchvision.transforms.ConvertImageDtype(
                  dtype=torch.float32
              )
          )
      else:
          raise Exception(
              "ConvertImageDtype transform requires torchvision"
          )
  
      # Convert Channels First
      self.transforms.append(
          Permute(dims=(0, 4, 1, 2, 3))
      )  # (B, T, H, W, C) -> (B, C, T, H, W)
  
      # Resize
      if self.resize:
          self.transforms.append(
              ResizeVideo(self.resize_size)
          )  # (B, C, T, H, W) -> (B, C, T, H', W')
  
      # Grayscale
      if self.grayscale:
          if TORCHVISION_AVAILABLE:
              self.transforms.append(
                  nn.Sequential(
                      Permute(
                          dims=(0, 2, 1, 3, 4)
                      ),  # (B, C, T, H, W) -> (B, T, C, H, W)
                      torchvision.transforms.Grayscale(),
                      Permute(
                          dims=(0, 2, 1, 3, 4)
                      ),  # (B, T, C, H, W) -> (B, C, T, H, W)
                  )
              )
          else:
              raise Exception(
                  "Grayscale transform requires torchvision"
              )
  
      # Normalize
      if self.normalize:
          self.transforms.append(
              NormalizeVideo(mean=norm_mean, std=norm_std)
          )
  
file_path: NeMo/nemo/collections/multimodal/speech_cv/modules/video_preprocessing.py
imports: import torch
  from torch import nn
  from nemo.collections.multimodal.speech_cv.parts.submodules.permute import Permute
  from nemo.core.classes import NeuralModule, typecheck
label_desc: Use image node_id 1 to create a new VideoPreprocessor object from inherited base classes: NeuralModule with example: obj = VideoPreprocessor(grayscale, normalize, resize, resize_size, norm_mean, norm_std)