class_docstr: Kinetics video loader. Construct the Kinetics video loader, then sample
  clips from the videos. For training and validation, a single clip is
  randomly sampled from every video with random cropping, scaling, and
  flipping. For testing, multiple clips are uniformaly sampled from every
  video with uniform cropping. For uniform cropping, we take the left, center,
  and right crop if the width is larger than height, or take top, center, and
  bottom crop if the height is larger than the width.
class_docstr_tok: ["Kinetics","video","loader",".","Construct","the","Kinetics","video","loader",",","then","sample","clips","from","the","videos",".","For","training","and","validation",",","a","single","clip","is","randomly","sampled","from","every","video","with","random","cropping",",","scaling",",","and","flipping",".","For","testing",",","multiple","clips","are","uniformaly","sampled","from","every","video","with","uniform","cropping",".","For","uniform","cropping",",","we","take","the","left",",","center",",","and","right","crop","if","the","width","is","larger","than","height",",","or","take","top",",","center",",","and","bottom","crop","if","the","height","is","larger","than","the","width","."]
code: def _gen_mask(self):
      if self.cfg.AUG.MASK_TUBE:
          num_masking_patches = round(
              np.prod(self.cfg.AUG.MASK_WINDOW_SIZE)
              * self.cfg.AUG.MASK_RATIO
          )
          min_mask = num_masking_patches // 5
          masked_position_generator = MaskingGenerator(
              mask_window_size=self.cfg.AUG.MASK_WINDOW_SIZE,
              num_masking_patches=num_masking_patches,
              max_num_patches=None,
              min_num_patches=min_mask,
          )
          mask = masked_position_generator()
          mask = np.tile(mask, (8, 1, 1))
      elif self.cfg.AUG.MASK_FRAMES:
          mask = np.zeros(
              shape=self.cfg.AUG.MASK_WINDOW_SIZE, dtype=int
          )
          n_mask = round(
              self.cfg.AUG.MASK_WINDOW_SIZE[0] * self.cfg.AUG.MASK_RATIO
          )
          mask_t_ind = random.sample(
              range(0, self.cfg.AUG.MASK_WINDOW_SIZE[0]), n_mask
          )
          mask[mask_t_ind, :, :] += 1
      else:
          num_masking_patches = round(
              np.prod(self.cfg.AUG.MASK_WINDOW_SIZE)
              * self.cfg.AUG.MASK_RATIO
          )
          max_mask = np.prod(self.cfg.AUG.MASK_WINDOW_SIZE[1:])
          min_mask = max_mask // 5
          masked_position_generator = MaskingGenerator3D(
              mask_window_size=self.cfg.AUG.MASK_WINDOW_SIZE,
              num_masking_patches=num_masking_patches,
              max_num_patches=max_mask,
              min_num_patches=min_mask,
          )
          mask = masked_position_generator()
      return mask
  
imports: import numpy
  import os
  import random
  import pandas
  import torch
  import torch.utils.data
  from torchvision import transforms
  import slowfast.utils.logging
  from slowfast.utils.env import pathmgr
  from .None import decoder
  from .None import transform
  from .None import utils
  from .None import video_container
  from .build import DATASET_REGISTRY
  from .random_erasing import RandomErasing
  from .transform import MaskingGenerator, MaskingGenerator3D, create_random_augment
label_desc: Use image node_id 6 for calling the Kinetics obj's underlying member method code with example usage: obj._gen_mask() and returns: mask