Skip to content

Commit

Permalink
Ignore hidden folders for image_dataset_from_directory
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinprasadhs authored May 30, 2023
1 parent ed62b30 commit 3f86351
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keras/utils/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ def index_directory(
else:
subdirs = []
for subdir in sorted(tf.io.gfile.listdir(directory)):
if tf.io.gfile.isdir(tf.io.gfile.join(directory, subdir)) and not subdir.startswith("."):
if (tf.io.gfile.isdir(tf.io.gfile.join(directory, subdir))
and not subdir.startswith(".")):
if subdir.endswith("/"):
subdir = subdir[:-1]
subdirs.append(subdir)
Expand Down

0 comments on commit 3f86351

Please sign in to comment.