Skip to content

Use sorted image list in toolbox.py #377

@gcroonen

Description

@gcroonen

I noticed in toolbox.py (used by for instance object_detection.py) the files are processed in order the OS presents them in. This can cause a lot of confusion when viewing and comparing the output images. I think it would better to process the files in sorted order.

Changing this from line 588 onwards:

        images = [
            read_rgb(img)
            for img in path.glob("*")
            if img.suffix.lower() in IMAGE_EXTENSIONS
        ]

To this:

        images = [
            read_rgb(img)
            for img in sorted(path.glob("*"))
            if img.suffix.lower() in IMAGE_EXTENSIONS
        ]

Solves this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions