def _generate_dummy_mvtec_3d_dataset(self) -> None:
        """Generate dummy MVTec 3D AD dataset in a temporary directory using the same convention as MVTec AD."""
        # MVTec 3D AD has multiple subcategories within the dataset.
        dataset_category = "dummy"

        # Create training and validation images.
        for split in ("train", "validation"):
            split_path = self.dataset_root / dataset_category / split / self.normal_category
            for directory in ("rgb", "xyz"):
                extension = ".tiff" if directory == "xyz" else ".png"
                for i in range(self.num_train):
                    label = LabelName.NORMAL
                    image_filename = split_path / directory / f"{i:03}{extension}"
                    self.image_generator.generate_image(label=label, image_filename=image_filename)

        ## Create test images.
        test_path = self.dataset_root / dataset_category / "test"
        for category in (self.normal_category, self.abnormal_category):
            label = LabelName.NORMAL if category == "good" else LabelName.ABNORMAL
            for i in range(self.num_test):
                # Generate image and mask.
                image, mask = self.image_generator.generate_image(label=label)

                # Create rgb, xyz, and gt filenames.
                for directory in ("rgb", "xyz", "gt"):
                    extension = ".png" if directory == "gt" else ".tiff" if directory == "xyz" else ".png"
                    filename = test_path / category / directory / f"{i:03}{extension}"

                    # Save image or mask.
                    if directory == "gt":
                        self.image_generator.save_image(filename=filename, image=img_as_ubyte(mask))
                    else:
                        self.image_generator.save_image(filename=filename, image=image)
Generate dummy MVTec 3D AD dataset in a temporary directory using the same convention as MVTec AD.
tests/helpers/data.py