Bread icon indicating copy to clipboard operation
Bread copied to clipboard

Simplified input directory of images

Open git9875 opened this issue 11 months ago • 0 comments

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.

git9875 avatar Mar 04 '25 03:03 git9875