@@ -19,6 +19,7 @@ def __init__(
19
19
data_folder : Optional [str ] = None ,
20
20
filepaths : Optional [List [str ]] = None ,
21
21
storage_opts : Dict [str , str ] = {},
22
+ verbose : bool = True ,
22
23
) -> None :
23
24
super ().__init__ ()
24
25
self .storage_opts = storage_opts
@@ -32,7 +33,7 @@ def __init__(
32
33
self .fs , dataset_path = fsspec .core .url_to_fs (
33
34
data_folder , ** self .storage_opts
34
35
)
35
- self ._filepaths = self .__get_filepaths (dataset_path )
36
+ self ._filepaths = self .__get_filepaths (dataset_path , verbose )
36
37
else :
37
38
assert filepaths is not None
38
39
if len (filepaths ) != len (set (filepaths )):
@@ -64,10 +65,11 @@ def get_name(self, item: Union[int, str]) -> str:
64
65
assert isinstance (item , str )
65
66
return item .split ("/" )[- 1 ]
66
67
67
- def __get_filepaths (self , dataset_path : str ) -> List [str ]:
68
+ def __get_filepaths (self , dataset_path : str , verbose : bool ) -> List [str ]:
68
69
"""See an issue here: https://github.com/fsspec/filesystem_spec/issues/1019
69
70
There's a problem with proper patterning on /**/ in fsspec"""
70
- print (f"Reading images from { dataset_path } " )
71
+ if verbose :
72
+ print (f"Reading images from { dataset_path } " )
71
73
filepaths = []
72
74
for ext in IMAGE_FILE_EXTENSIONS :
73
75
# initial *.ext search, top level
0 commit comments