class_docstr: Avenue DataModule class.
  
  Args:
      root (Path | str): Path to the root of the dataset
      gt_dir (Path | str): Path to the ground truth files
      clip_length_in_frames (int, optional): Number of video frames in each clip.
      frames_between_clips (int, optional): Number of frames between each consecutive video clip.
      target_frame (VideoTargetFrame): Specifies the target frame in the video clip, used for ground truth retrieval
      task TaskType): Task type, 'classification', 'detection' or 'segmentation'
      image_size (int | tuple[int, int] | None, optional): Size of the input image.
          Defaults to None.
      center_crop (int | tuple[int, int] | None, optional): When provided, the images will be center-cropped
          to the provided dimensions.
      normalize (bool): When True, the images will be normalized to the ImageNet statistics.
      train_batch_size (int, optional): Training batch size. Defaults to 32.
      eval_batch_size (int, optional): Test batch size. Defaults to 32.
      num_workers (int, optional): Number of workers. Defaults to 8.
      transform_config_train (str | A.Compose | None, optional): Config for pre-processing
          during training.
          Defaults to None.
      transform_config_val (str | A.Compose | None, optional): Config for pre-processing
          during validation.
          Defaults to None.
      val_split_mode (ValSplitMode): Setting that determines how the validation subset is obtained.
      val_split_ratio (float): Fraction of train or test images that will be reserved for validation.
      seed (int | None, optional): Seed which may be set to a fixed value for reproducibility.
docstr: Convert mask files to .png.
  
  The masks in the Avenue datasets are provided as matlab (.mat) files. To speed up data loading, we convert the
  masks into a sepaarte .png file for every video frame in the dataset.
  
  Args:
      gt_dir (Path): Ground truth folder of the dataset.
docstr_tok: ["Convert","mask","files","to",".png",".","The","masks","in","the","Avenue","datasets","are","provided","as","matlab","(",".mat",")","files",".","To","speed","up","data","loading",",","we","convert","the","masks","into","a","sepaarte",".png","file","for","every","video","frame","in","the","dataset",".","Args",":","gt_dir","(","Path",")",":","Ground","truth","folder","of","the","dataset","."]
code: def _convert_masks(gt_dir: Path) -> None:
      """Convert mask files to .png.
  
      The masks in the Avenue datasets are provided as matlab (.mat) files. To speed up data loading, we convert the
      masks into a sepaarte .png file for every video frame in the dataset.
  
      Args:
          gt_dir (Path): Ground truth folder of the dataset.
      """
      # convert masks to numpy
      masks_dir = gt_dir / "testing_label_mask"
      # get file names
      mat_files = list(masks_dir.glob("*.mat"))
      mask_folders = [matfile.with_suffix("") for matfile in mat_files]
      if not all(folder.exists() for folder in mask_folders):
          # convert mask files to images
          logger.info("converting mat files to .png format.")
          for mat_file, mask_folder in zip(mat_files, mask_folders):
              mat = scipy.io.loadmat(mat_file)
              mask_folder.mkdir(parents=True, exist_ok=True)
              masks = mat["volLabel"].squeeze()
              for idx, mask in enumerate(masks):
                  filename = (
                      mask_folder
                      / str(idx).zfill(int(math.log10(len(masks)) + 1))
                  ).with_suffix(".png")
                  cv2.imwrite(str(filename), mask)
  
imports: from __future__ import annotations
  import logging
  import math
  from pathlib import Path
  from shutil import move
  from typing import Callable
  import albumentations
  import cv2
  import numpy
  import scipy.io
  from pandas import DataFrame
  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
  from anomalib.data.utils.video import ClipsIndexer
label_desc: Use image node_id 3 for calling the Avenue obj's underlying member method code with example usage: obj._convert_masks(gt_dir) without return types