class_docstr: Randomly selects a rectangle region in an image and erases its pixels.
      'Random Erasing Data Augmentation' by Zhong et al.
      See https://arxiv.org/pdf/1708.04896.pdf
      This variant of RandomErasing is intended to be applied to either a batch
      or single image tensor after it has been normalized by dataset mean and std.
  Args:
       probability: Probability that the Random Erasing operation will be performed.
       min_area: Minimum percentage of erased area wrt input image area.
       max_area: Maximum percentage of erased area wrt input image area.
       min_aspect: Minimum aspect ratio of erased area.
       mode: pixel color mode, one of 'const', 'rand', or 'pixel'
          'const' - erase block is constant color of 0 for all channels
          'rand'  - erase block is same per-channel random (normal) color
          'pixel' - erase block is per-pixel random (normal) color
      max_count: maximum number of erasing blocks per image, area per box is scaled by count.
          per-image count is randomly chosen between 1 and this value.
code: def _erase_cube(
      self,
      img,
      batch_start,
      batch_size,
      chan,
      img_h,
      img_w,
      dtype,
  ):
      if random.random() > self.probability:
          return
      area = img_h * img_w
      count = (
          self.min_count
          if self.min_count == self.max_count
          else random.randint(self.min_count, self.max_count)
      )
      for _ in range(count):
          for _ in range(100):
              target_area = (
                  random.uniform(self.min_area, self.max_area)
                  * area
                  / count
              )
              aspect_ratio = math.exp(
                  random.uniform(*self.log_aspect_ratio)
              )
              h = int(round(math.sqrt(target_area * aspect_ratio)))
              w = int(round(math.sqrt(target_area / aspect_ratio)))
              if w < img_w and h < img_h:
                  top = random.randint(0, img_h - h)
                  left = random.randint(0, img_w - w)
                  for i in range(batch_start, batch_size):
                      img_instance = img[i]
                      img_instance[
                          :, top : top + h, left : left + w
                      ] = _get_pixels(
                          self.per_pixel,
                          self.rand_color,
                          (chan, h, w),
                          dtype=dtype,
                          device=self.device,
                      )
                  break
  
file_path: SlowFast/slowfast/datasets/random_erasing.py
imports: import math
  import random
  import torch
label_desc: Use image node_id 3 for calling the RandomErasing obj's underlying member method code with example usage: obj._erase_cube(img, batch_start, batch_size, chan, img_h, img_w, dtype) without return types