MVTec 3D Datamodule#
MVTec 3D-AD Datamodule.
This module provides a PyTorch Lightning DataModule for the MVTec 3D-AD dataset. The dataset contains RGB and depth image pairs for anomaly detection tasks.
Example
Create a MVTec3D datamodule:
>>> from anomalib.data import MVTec3D
>>> datamodule = MVTec3D(
... root="./datasets/MVTec3D",
... category="bagel"
... )
- License:
MVTec 3D-AD dataset is released under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0). https://creativecommons.org/licenses/by-nc-sa/4.0/
- Reference:
Paul Bergmann, Xin Jin, David Sattlegger, Carsten Steger: The MVTec 3D-AD Dataset for Unsupervised 3D Anomaly Detection and Localization. In: Proceedings of the 17th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 5: VISAPP, 202-213, 2022. DOI: 10.5220/0010865000003124
- class anomalib.data.datamodules.depth.mvtec_3d.MVTec3D(root='./datasets/MVTec3D', category='bagel', train_batch_size=32, eval_batch_size=32, num_workers=8, train_augmentations=None, val_augmentations=None, test_augmentations=None, augmentations=None, test_split_mode=TestSplitMode.FROM_DIR, test_split_ratio=0.2, val_split_mode=ValSplitMode.SAME_AS_TEST, val_split_ratio=0.5, seed=None)#
Bases:
AnomalibDataModuleMVTec 3D-AD Datamodule.
- Parameters:
root (
Path|str|None) – Path to the root of the dataset. Defaults to"./datasets/MVTec3D".category (
str) – Category of the MVTec3D dataset (e.g."bottle"or"cable"). Defaults to"bagel".train_batch_size (
int) – Training batch size. Defaults to32.eval_batch_size (
int) – Test batch size. Defaults to32.num_workers (
int) – Number of workers for data loading. Defaults to8.train_augmentations (
Transform|None) – Augmentations to apply to the training images Defaults toNone.val_augmentations (
Transform|None) – Augmentations to apply to the validation images. Defaults toNone.test_augmentations (
Transform|None) – Augmentations to apply to the test images. Defaults toNone.augmentations (
Transform|None) – General augmentations to apply if stage-specific augmentations are not provided.test_split_mode (
TestSplitMode|str) – Method to create test set. Defaults toTestSplitMode.FROM_DIR.test_split_ratio (
float) – Fraction of data to use for testing. Defaults to0.2.val_split_mode (
ValSplitMode|str) – Method to create validation set. Defaults toValSplitMode.SAME_AS_TEST.val_split_ratio (
float) – Fraction of data to use for validation. Defaults to0.5.seed (
int|None) – Random seed for reproducibility. Defaults toNone.