def _generate_dummy_datumaro_dataset(self) -> None:
        """Generates dummy Datumaro dataset in a temporary directory."""
        # generate images
        image_root = self.dataset_root / "images" / "default"
        image_root.mkdir(parents=True, exist_ok=True)

        file_names: list[str] = []

        # Create normal images
        for i in range(self.num_train + self.num_test):
            label = LabelName.NORMAL
            image_filename = image_root / f"normal_{i:03}.png"
            file_names.append(image_filename)
            self.image_generator.generate_image(label, image_filename)

        # Create abnormal images
        for i in range(self.num_test):
            label = LabelName.ABNORMAL
            image_filename = image_root / f"abnormal_{i:03}.png"
            file_names.append(image_filename)
            self.image_generator.generate_image(label, image_filename)

        # create annotation file
        annotation_file = self.dataset_root / "annotations" / "default.json"
        annotation_file.parent.mkdir(parents=True, exist_ok=True)
        annotations = {
            "categories": {"label": {"labels": [{"name": "Normal"}, {"name": "Anomalous"}]}},
            "items": [],
        }
        for file_name in file_names:
            annotations["items"].append({
                "annotations": [{"label_id": 1 if "abnormal" in str(file_name) else 0}],
                "image": {"path": file_name.name},
            })
        with annotation_file.open("w") as f:
            json.dump(annotations, f)
Generates dummy Datumaro dataset in a temporary directory.
tests/helpers/data.py