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: Download the dataset and ground truth if not available, and convert mask files to a more usable format.
docstr_tok: ["Download","the","dataset","and","ground","truth","if","not","available",",","and","convert","mask","files","to","a","more","usable","format","."]
code: def prepare_data(self) -> None:
      """Download the dataset and ground truth if not available, and convert mask files to a more usable format."""
      if self.root.is_dir():
          logger.info("Found the dataset.")
      else:
          download_and_extract(self.root, DATASET_DOWNLOAD_INFO)
          download_and_extract(self.gt_dir, ANNOTATIONS_DOWNLOAD_INFO)
  
          # move contents to root
          folder_names = ["Avenue Dataset", "ground_truth_demo"]
          for root, folder_name in zip(
              [self.root, self.gt_dir], folder_names
          ):
              extracted_folder = root / folder_name
              for filename in extracted_folder.glob("*"):
                  move(str(filename), str(root / filename.name))
              extracted_folder.rmdir()
  
          # convert masks
          self._convert_masks(self.gt_dir)
  
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 2 for calling the Avenue obj's underlying member method code with example usage: obj.prepare_data() without return types