From c07f62772f002416c5fbe4146fa7d4394aa79ec1 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Fri, 2 Aug 2024 05:42:30 -0700 Subject: [PATCH] [fbsync] Add Path type annotation for ImageFolder (#8526) Reviewed By: vmoens Differential Revision: D60596246 fbshipit-source-id: 956dfd072507c3205d0d928ef5d7c029b429505f --- 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 daeed158a4b..87513adfedb 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,