class_docstr: BTech Lightning Data Module.
  
  Args:
  
      root (Path | str): Path to the BTech dataset.
      category (str): Name of the BTech category.
      image_size (int | tuple[int, int] | None, optional): Variable to which image is resized. Defaults to None.
      center_crop (int | tuple[int, int] | None, optional): When provided, the images will be center-cropped to the
          provided dimensions.
          Defaults to None.
      normalization (str | InputNormalizationMethod, optional): When True, the images will be normalized to the
          ImageNet statistics.
          Defaults to InputNormalizationMethod.IMAGENET.
      train_batch_size (int, optional): Training batch size.
          Defaults to 32.
      eval_batch_size (int, optional): Eval batch size.
          Defaults to 32.
      num_workers (int, optional): Number of workers. Defaults to 8.
      task (TaskType, optional): Task type.
          Defaults to TaskType.SEGMENTATION.
      transform_config_train (str | A.Compose | None, optional): Config for pre-processing during training.
          Defaults to None.
      transform_config_eval (str | A.Compose | None, optional): Config for pre-processing during validation.
          Defaults to None.
      test_split_mode (TestSplitMode, optional): Setting that determines how the testing subset is obtained.
          Defaults to TestSplitMode.FROM_DIR.
      test_split_ratio (float, optional): Fraction of images from the train set that will be reserved for testing.
          Defaults to 0.2.
      val_split_mode (ValSplitMode, optional): Setting that determines how the validation subset is obtained.
          Defaults to ValSplitMode.SAME_AS_TEST.
      val_split_ratio (float, optional): Fraction of train or test images that will be reserved for validation.
          Defaults to 0.5.
      seed (int | None, optional): Seed which may be set to a fixed value for reproducibility. Defaults to None.
  
  Examples:
      >>> from anomalib.data import BTech
      >>> datamodule = BTech(
      ...     root="./datasets/BTech",
      ...     category="01",
      ...     image_size=256,
      ...     train_batch_size=32,
      ...     eval_batch_size=32,
      ...     num_workers=8,
      ...     transform_config_train=None,
      ...     transform_config_eval=None,
      ... )
      >>> datamodule.setup()
  
      >>> i, data = next(enumerate(datamodule.train_dataloader()))
      >>> data.keys()
      dict_keys(['image'])
      >>> data["image"].shape
      torch.Size([32, 3, 256, 256])
  
      >>> i, data = next(enumerate(datamodule.val_dataloader()))
      >>> data.keys()
      dict_keys(['image_path', 'label', 'mask_path', 'image', 'mask'])
      >>> data["image"].shape, data["mask"].shape
      (torch.Size([32, 3, 256, 256]), torch.Size([32, 256, 256]))
class_docstr_tok: ["BTech","Lightning","Data","Module",".","Args",":","root","(","Path","|","str",")",":","Path","to","the","BTech","dataset",".","category","(","str",")",":","Name","of","the","BTech","category",".","image_size","(","int","|","tuple","[","int",",","int","]","|","None",",","optional",")",":","Variable","to","which","image","is","resized",".","Defaults","to","None",".","center_crop","(","int","|","tuple","[","int",",","int","]","|","None",",","optional",")",":","When","provided",",","the","images","will","be","center-cropped","to","the","provided","dimensions",".","Defaults","to","None",".","normalization","(","str","|","InputNormalizationMethod",",","optional",")",":","When","True",",","the","images","will","be","normalized","to","the","ImageNet","statistics",".","Defaults","to","InputNormalizationMethod.IMAGENET",".","train_batch_size","(","int",",","optional",")",":","Training","batch","size",".","Defaults","to","32.","eval_batch_size","(","int",",","optional",")",":","Eval","batch","size",".","Defaults","to","32.","num_workers","(","int",",","optional",")",":","Number","of","workers",".","Defaults","to","8.","task","(","TaskType",",","optional",")",":","Task","type",".","Defaults","to","TaskType.SEGMENTATION",".","transform_config_train","(","str","|","A.Compose","|","None",",","optional",")",":","Config","for","pre-processing","during","training",".","Defaults","to","None",".","transform_config_eval","(","str","|","A.Compose","|","None",",","optional",")",":","Config","for","pre-processing","during","validation",".","Defaults","to","None",".","test_split_mode","(","TestSplitMode",",","optional",")",":","Setting","that","determines","how","the","testing","subset","is","obtained",".","Defaults","to","TestSplitMode.FROM_DIR",".","test_split_ratio","(","float",",","optional",")",":","Fraction","of","images","from","the","train","set","that","will","be","reserved","for","testing",".","Defaults","to","0.2.","val_split_mode","(","ValSplitMode",",","optional",")",":","Setting","that","determines","how","the","validation","subset","is","obtained",".","Defaults","to","ValSplitMode.SAME_AS_TEST",".","val_split_ratio","(","float",",","optional",")",":","Fraction","of","train","or","test","images","that","will","be","reserved","for","validation",".","Defaults","to","0.5.","seed","(","int","|","None",",","optional",")",":","Seed","which","may","be","set","to","a","fixed","value","for","reproducibility",".","Defaults","to","None",".","Examples",":",">",">",">","from","anomalib.data","import","BTech",">",">",">","datamodule","=","BTech","(","...","root=","''",".\/datasets\/BTech","''",",","...","category=","''","01","''",",","...","image_size=256",",","...","train_batch_size=32",",","...","eval_batch_size=32",",","...","num_workers=8",",","...","transform_config_train=None",",","...","transform_config_eval=None",",","...",")",">",">",">","datamodule.setup","(",")",">",">",">","i",",","data","=","next","(","enumerate","(","datamodule.train_dataloader","(",")",")",")",">",">",">","data.keys","(",")","dict_keys","(","[","'image","'","]",")",">",">",">","data","[","``","image","''","]",".shape","torch.Size","(","[","32",",","3",",","256",",","256","]",")",">",">",">","i",",","data","=","next","(","enumerate","(","datamodule.val_dataloader","(",")",")",")",">",">",">","data.keys","(",")","dict_keys","(","[","'image_path","'",",","'label","'",",","'mask_path","'",",","'image","'",",","'mask","'","]",")",">",">",">","data","[","``","image","''","]",".shape",",","data","[","``","mask","''","]",".shape","(","torch.Size","(","[","32",",","3",",","256",",","256","]",")",",","torch.Size","(","[","32",",","256",",","256","]",")",")"]
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.category = Path(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 = BTechDataset(
          task=task,
          transform=transform_train,
          split=Split.TRAIN,
          root=root,
          category=category,
      )
      self.test_data = BTechDataset(
          task=task,
          transform=transform_eval,
          split=Split.TEST,
          root=root,
          category=category,
      )
  
imports: from __future__ import annotations
  import logging
  import shutil
  from pathlib import Path
  import albumentations
  import cv2
  import pandas
  from pandas.core.frame import DataFrame
  from tqdm import tqdm
  from anomalib.data.base import AnomalibDataModule, AnomalibDataset
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import DownloadInfo, InputNormalizationMethod, LabelName, Split, TestSplitMode, ValSplitMode, download_and_extract, get_transforms
label_desc: Use image node_id 1 to create a new BTech object from inherited base classes: AnomalibDataModule with example: obj = BTech(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)