diff --git a/img2dataset/reader.py b/img2dataset/reader.py index 3fd491a..2c17c3b 100644 --- a/img2dataset/reader.py +++ b/img2dataset/reader.py @@ -57,7 +57,7 @@ def __init__( self.tmp_path = tmp_path if fs.isdir(url_path): - self.input_files = sorted(fs.glob(url_path + "/*." + input_format)) + self.input_files = sorted(fs.glob(url_path.rstrip("/") + "/*." + input_format)) if len(self.input_files) == 0: raise ValueError(f"No file found at path {url_path} with extension {input_format}") else: