cannot import name 'TaskType' from 'anomalib.data' #1570
-
https://anomalib.readthedocs.io/en/v1/markdown/guides/reference/data/image/folder.html folder_datamodule = Folder(
root=dataset_root,
normal_dir="good",
abnormal_dir="crack",
task=TaskType.SEGMENTATION,
mask_dir=dataset_root / "mask" / "crack",
image_size=256,
normalization=InputNormalizationMethod.NONE,
)
folder_datamodule.setup() Folder ? TaskType ? from anomalib.data import TaskType anomalib 1.0.0.dev0 E:\anomalib folder_dataset_classification_train = FolderDataset(
normal_dir=dataset_root / "good",
abnormal_dir=dataset_root / "crack",
split="train",
transform=transform,
task=TaskType.CLASSIFICATION,
) FolderDataset ?? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@monkeycc, can you confirm whether you checked out the v1, from which you install anomalib? If you install it properly you should have the following imports: Folderfrom anomalib.data import Folder
# or
from anomalib.data.image.folder import FolderDataset TaskTypefrom anomalib.utils.types import TaskType
FolderDatasetfrom anomalib.data.image.folder import FolderDataset Let me know if you still have any questions. Good luck! |
Beta Was this translation helpful? Give feedback.
@monkeycc, can you confirm whether you checked out the v1, from which you install anomalib?
If you install it properly you should have the following imports:
Folder
TaskType
FolderDataset
Let me know if you still have any questions. Good luck!