def _setup(self, _stage: str | None = None) -> None:
        """Set up the datasets and perform dynamic subset splitting."""
        self.train_data = RealIADDataset(
            split=Split.TRAIN,
            root=self.root,
            category=self.category,
            resolution=self.resolution,
            json_path=self.json_path,
        )
        self.test_data = RealIADDataset(
            split=Split.TEST,
            root=self.root,
            category=self.category,
            resolution=self.resolution,
            json_path=self.json_path,
        )
Set up the datasets and perform dynamic subset splitting.
src/anomalib/data/datamodules/image/realiad.py