From 46a64d9e2a6f14f6eb7974f7cb2e83e8d228c3ff Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 15 Jul 2024 09:15:48 +0100 Subject: [PATCH] Add Path type annotation for ImageFolder --- torchvision/datasets/folder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/datasets/folder.py b/torchvision/datasets/folder.py index 9ee06b6a650..8f2f65c7b61 100644 --- a/torchvision/datasets/folder.py +++ b/torchvision/datasets/folder.py @@ -318,7 +318,7 @@ class ImageFolder(DatasetFolder): def __init__( self, - root: str, + root: Union[str, Path], transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, loader: Callable[[str], Any] = default_loader,