Skip to content

Simplified input directory of images #12

@git9875

Description

@git9875

subsets = os.listdir(root)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions