Bread
Bread copied to clipboard
Simplified input directory of images
https://github.com/mingcv/Bread/blob/e0c50680f38ac9f417ef6a233448f94e68f332f2/datasets/low_light_test.py#L13
The code block can be replaced with this:
directory_name = os.path.basename(root)
print("directory_name", directory_name)
img_files = os.listdir(root)
for img_file in img_files:
if not (img_file.endswith('.jpg') or img_file.endswith('.jpeg') or img_file.endswith('.gif') or img_file.endswith('.png')):
continue
self.items.append((
os.path.join(root, img_file),
directory_name,
img_file
))
This enables the "root" directory for the dataset to be the intended input directory of images, without requiring any subdirectories.