class_docstr: VisA Datamodule.
  
  Args:
      root (Path | str): Path to the root of the dataset
      category (str): Category of the MVTec dataset (e.g. "bottle" or "cable").
      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.
      task (TaskType): Task type, 'classification', 'detection' or 'segmentation'
      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.
      test_split_mode (TestSplitMode): Setting that determines how the testing subset is obtained.
      test_split_ratio (float): Fraction of images from the train set that will be reserved for testing.
      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.
class_docstr_tok: ["VisA","Datamodule",".","Args",":","root","(","Path","|","str",")",":","Path","to","the","root","of","the","dataset","category","(","str",")",":","Category","of","the","MVTec","dataset","(","e.g",".","``","bottle","''","or","``","cable","''",")",".","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.","task","(","TaskType",")",":","Task","type",",","'classification","'",",","'detection","'","or","'segmentation'","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",".","test_split_mode","(","TestSplitMode",")",":","Setting","that","determines","how","the","testing","subset","is","obtained",".","test_split_ratio","(","float",")",":","Fraction","of","images","from","the","train","set","that","will","be","reserved","for","testing",".","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","."]
code: def __init__(
      self,
      root: Path | str,
      category: str,
      image_size: int | tuple[int, int] | None = None,
      center_crop: int | tuple[int, int] | None = None,
      normalization: str
      | InputNormalizationMethod = InputNormalizationMethod.IMAGENET,
      train_batch_size: int = 32,
      eval_batch_size: int = 32,
      num_workers: int = 8,
      task: TaskType = TaskType.SEGMENTATION,
      transform_config_train: str | A.Compose | None = None,
      transform_config_eval: str | A.Compose | None = None,
      test_split_mode: TestSplitMode = TestSplitMode.FROM_DIR,
      test_split_ratio: float = 0.2,
      val_split_mode: ValSplitMode = ValSplitMode.SAME_AS_TEST,
      val_split_ratio: float = 0.5,
      seed: int | None = None,
  ) -> None:
      super().__init__(
          train_batch_size=train_batch_size,
          eval_batch_size=eval_batch_size,
          num_workers=num_workers,
          test_split_mode=test_split_mode,
          test_split_ratio=test_split_ratio,
          val_split_mode=val_split_mode,
          val_split_ratio=val_split_ratio,
          seed=seed,
      )
  
      self.root = Path(root)
      self.split_root = self.root / "visa_pytorch"
      self.category = category
  
      transform_train = get_transforms(
          config=transform_config_train,
          image_size=image_size,
          center_crop=center_crop,
          normalization=InputNormalizationMethod(normalization),
      )
      transform_eval = get_transforms(
          config=transform_config_eval,
          image_size=image_size,
          center_crop=center_crop,
          normalization=InputNormalizationMethod(normalization),
      )
  
      self.train_data = VisaDataset(
          task=task,
          transform=transform_train,
          split=Split.TRAIN,
          root=self.split_root,
          category=category,
      )
      self.test_data = VisaDataset(
          task=task,
          transform=transform_eval,
          split=Split.TEST,
          root=self.split_root,
          category=category,
      )
  
imports: from __future__ import annotations
  import csv
  import logging
  import shutil
  from pathlib import Path
  import albumentations
  import cv2
  from anomalib.data.base import AnomalibDataModule, AnomalibDataset
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import DownloadInfo, InputNormalizationMethod, Split, TestSplitMode, ValSplitMode, download_and_extract, get_transforms
  from .mvtec import make_mvtec_dataset
label_desc: Use image node_id 1 to create a new Visa object from inherited base classes: AnomalibDataModule with example: obj = Visa(root, category, image_size, center_crop, normalization, train_batch_size, eval_batch_size, num_workers, task, transform_config_train, transform_config_eval, test_split_mode, test_split_ratio, val_split_mode, val_split_ratio, seed)