class_docstr: Clips class for UCSDped dataset.
docstr: Retrieve the masks from the file system.
docstr_tok: ["Retrieve","the","masks","from","the","file","system","."]
code: def get_mask(self, idx) -> np.ndarray | None:
      """Retrieve the masks from the file system."""
  
      video_idx, frames_idx = self.get_clip_location(idx)
      mask_folder = self.mask_paths[video_idx]
      if mask_folder == "":  # no gt masks available for this clip
          return None
      frames = self.clips[video_idx][frames_idx]
  
      mask_frames = sorted(Path(mask_folder).glob("*.bmp"))
      mask_paths = [mask_frames[idx] for idx in frames.int()]
  
      masks = np.stack(
          [
              cv2.imread(str(mask_path), flags=0) / 255.0
              for mask_path in mask_paths
          ]
      )
      return masks
  
imports: from __future__ import annotations
  import logging
  from pathlib import Path
  from shutil import move
  from typing import Any, Callable
  import albumentations
  import cv2
  import numpy
  import torch
  from pandas import DataFrame
  from torch import Tensor
  from anomalib.data.base import AnomalibVideoDataModule, AnomalibVideoDataset
  from anomalib.data.base.video import VideoTargetFrame
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import DownloadInfo, InputNormalizationMethod, Split, ValSplitMode, download_and_extract, get_transforms, read_image
  from anomalib.data.utils.video import ClipsIndexer
label_desc: Use image node_id 1 for calling the UCSDpedClipsIndexer obj's underlying member method code with example usage: obj.get_mask(idx) and returns: masks, None