-
-
Save paularamo/46fdfe6bcfa27e5e027a7f4c3a0dc5bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from anomalib.data.folder import Folder | |
from anomalib.data.task_type import TaskType | |
datamodule = Folder( | |
root=Path.cwd() / "cubes", | |
normal_dir="normal", | |
abnormal_dir="abnormal", | |
normal_split_ratio=0.2, | |
image_size=(256, 256), | |
train_batch_size=32, | |
eval_batch_size=32, | |
task=TaskType.CLASSIFICATION, | |
) | |
datamodule.setup() # Split the data to train/val/test/prediction sets. | |
datamodule.prepare_data() # Create train/val/test/predic dataloaders | |
i, data = next(enumerate(datamodule.val_dataloader())) | |
print(data.keys()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment