class_docstr: Folder DataModule.
  
  Args:
      normal_dir (str | Path): Name of the directory containing normal images.
          Defaults to "normal".
      root (str | Path | None): Path to the root folder containing normal and abnormal dirs.
      abnormal_dir (str | Path | None): Name of the directory containing abnormal images.
          Defaults to "abnormal".
      normal_test_dir (str | Path | None, optional): Path to the directory containing
          normal images for the test dataset. Defaults to None.
      mask_dir (str | Path | None, optional): Path to the directory containing
          the mask annotations. Defaults to None.
      normal_depth_dir (str | Path | None, optional): Path to the directory containing
          normal depth images for the test dataset. Normal test depth images will be a split of `normal_dir`
      abnormal_depth_dir (str | Path | None, optional): Path to the directory containing
          abnormal depth images for the test dataset.
      normal_test_depth_dir (str | Path | None, optional): Path to the directory containing
          normal depth images for the test dataset. Normal test images will be a split of `normal_dir`
          if `None`. Defaults to None.
      normal_split_ratio (float, optional): Ratio to split normal training images and add to the
          test set in case test set doesn't contain any normal images.
          Defaults to 0.2.
      extensions (tuple[str, ...] | None, optional): Type of the image extensions to read from the
          directory. Defaults to None.
      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.
      test_batch_size (int, optional): Test batch size. Defaults to 32.
      num_workers (int, optional): Number of workers. Defaults to 8.
      task (TaskType, optional): Task type. Could be ``classification``, ``detection`` or ``segmentation``.
          Defaults to 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 used during random subset splitting.
class_docstr_tok: ["Folder","DataModule",".","Args",":","normal_dir","(","str","|","Path",")",":","Name","of","the","directory","containing","normal","images",".","Defaults","to","``","normal","''",".","root","(","str","|","Path","|","None",")",":","Path","to","the","root","folder","containing","normal","and","abnormal","dirs",".","abnormal_dir","(","str","|","Path","|","None",")",":","Name","of","the","directory","containing","abnormal","images",".","Defaults","to","``","abnormal","''",".","normal_test_dir","(","str","|","Path","|","None",",","optional",")",":","Path","to","the","directory","containing","normal","images","for","the","test","dataset",".","Defaults","to","None",".","mask_dir","(","str","|","Path","|","None",",","optional",")",":","Path","to","the","directory","containing","the","mask","annotations",".","Defaults","to","None",".","normal_depth_dir","(","str","|","Path","|","None",",","optional",")",":","Path","to","the","directory","containing","normal","depth","images","for","the","test","dataset",".","Normal","test","depth","images","will","be","a","split","of","`","normal_dir","`","abnormal_depth_dir","(","str","|","Path","|","None",",","optional",")",":","Path","to","the","directory","containing","abnormal","depth","images","for","the","test","dataset",".","normal_test_depth_dir","(","str","|","Path","|","None",",","optional",")",":","Path","to","the","directory","containing","normal","depth","images","for","the","test","dataset",".","Normal","test","images","will","be","a","split","of","`","normal_dir","`","if","`","None","`",".","Defaults","to","None",".","normal_split_ratio","(","float",",","optional",")",":","Ratio","to","split","normal","training","images","and","add","to","the","test","set","in","case","test","set","does","n't","contain","any","normal","images",".","Defaults","to","0.2.","extensions","(","tuple","[","str",",","...","]","|","None",",","optional",")",":","Type","of","the","image","extensions","to","read","from","the","directory",".","Defaults","to","None",".","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.","test_batch_size","(","int",",","optional",")",":","Test","batch","size",".","Defaults","to","32.","num_workers","(","int",",","optional",")",":","Number","of","workers",".","Defaults","to","8.","task","(","TaskType",",","optional",")",":","Task","type",".","Could","be","``","classification","``",",","``","detection","``","or","``","segmentation","``",".","Defaults","to","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","used","during","random","subset","splitting","."]
code: def __init__(
      self,
      normal_dir: str | Path,
      root: str | Path | None = None,
      abnormal_dir: str | Path | None = None,
      normal_test_dir: str | Path | None = None,
      mask_dir: str | Path | None = None,
      normal_depth_dir: str | Path | None = None,
      abnormal_depth_dir: str | Path | None = None,
      normal_test_depth_dir: str | Path | None = None,
      extensions: tuple[str] | None = None,
      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.FROM_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,
      )
  
      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 = Folder3DDataset(
          task=task,
          transform=transform_train,
          split=Split.TRAIN,
          root=root,
          normal_dir=normal_dir,
          abnormal_dir=abnormal_dir,
          normal_test_dir=normal_test_dir,
          mask_dir=mask_dir,
          normal_depth_dir=normal_depth_dir,
          abnormal_depth_dir=abnormal_depth_dir,
          normal_test_depth_dir=normal_test_depth_dir,
          extensions=extensions,
      )
  
      self.test_data = Folder3DDataset(
          task=task,
          transform=transform_eval,
          split=Split.TEST,
          root=root,
          normal_dir=normal_dir,
          abnormal_dir=abnormal_dir,
          normal_test_dir=normal_test_dir,
          normal_depth_dir=normal_depth_dir,
          abnormal_depth_dir=abnormal_depth_dir,
          normal_test_depth_dir=normal_test_depth_dir,
          mask_dir=mask_dir,
          extensions=extensions,
      )
  
file_path: anomalib/src/anomalib/data/folder_3d.py
imports: from __future__ import annotations
  from pathlib import Path
  import albumentations
  from pandas import DataFrame, isna
  from anomalib.data.base import AnomalibDataModule, AnomalibDepthDataset
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import DirType, InputNormalizationMethod, LabelName, Split, TestSplitMode, ValSplitMode, get_transforms
  from anomalib.data.utils.path import _prepare_files_labels, _resolve_path
label_desc: Use image node_id 1 to create a new Folder3D object from inherited base classes: AnomalibDataModule with example: obj = Folder3D(normal_dir, root, abnormal_dir, normal_test_dir, mask_dir, normal_depth_dir, abnormal_depth_dir, normal_test_depth_dir, extensions, 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)