class_docstr: Spatial Video Mask
  
  Will mask videos frames in the spatial dimensions using horizontal and vertical masks
  
  params: 
      num_horizontal_masks: number of horizontal masks
      num_vertical_masks: number of vertical masks
      max_h: maximum width of horizontal mask  
      max_v: maximum width of vertical mask
      mean_frame: mask using video mean instead of zeros
class_docstr_tok: ["Spatial","Video","Mask","Will","mask","videos","frames","in","the","spatial","dimensions","using","horizontal","and","vertical","masks","params",":","num_horizontal_masks",":","number","of","horizontal","masks","num_vertical_masks",":","number","of","vertical","masks","max_h",":","maximum","width","of","horizontal","mask","max_v",":","maximum","width","of","vertical","mask","mean_frame",":","mask","using","video","mean","instead","of","zeros"]
code: def forward(self, input_signal, length):
      # (B, C, T, H, W)
      shape = input_signal.shape
  
      # Batch loop
      for b in range(shape[0]):
          # Mask Value
          mask_value = (
              input_signal[b, :, : length[b]].mean()
              if self.mean_frame
              else 0.0
          )
  
          # Horizontal Mask loop
          for i in range(self.num_horizontal_masks):
              # Start index
              x = self.random.randint(0, shape[3] - self.max_h)
  
              # Mask width
              w = self.random.randint(0, self.max_h)
  
              # Apply mask
              input_signal[b, :, :, x : x + w] = mask_value
  
          # Vertical Mask loop
          for i in range(self.num_vertical_masks):
              # Start index
              x = self.random.randint(0, shape[4] - self.max_v)
  
              # Mask width
              w = self.random.randint(0, self.max_v)
  
              # Apply mask
              input_signal[b, :, :, :, x : x + w] = mask_value
  
      return input_signal
  
file_path: NeMo/nemo/collections/multimodal/speech_cv/modules/video_augment.py
imports: import random
  from collections import OrderedDict
  import torch
  from torch import nn
  from nemo.core.classes.module import NeuralModule
  from nemo.core.neural_types import NeuralType, VideoSignal
label_desc: Use image node_id 2 for calling the SpatialVideoMasking obj's underlying member method code with example usage: obj.forward(input_signal, length) and returns: input_signal