Skip to content

feat: input files check (filter the unreadable files)#38

Open
abc123yuanrui wants to merge 1 commit intoGoGoDuck912:masterfrom
abc123yuanrui:master
Open

feat: input files check (filter the unreadable files)#38
abc123yuanrui wants to merge 1 commit intoGoGoDuck912:masterfrom
abc123yuanrui:master

Conversation

@abc123yuanrui
Copy link

fix the issue #37

@jutanke
Copy link

jutanke commented Mar 17, 2021

@abc123yuanrui @peikeli Do you think we can achieve this in an easier way by simple filtering; by replacing

https://github.com/PeikeLi/Self-Correction-Human-Parsing/blob/ee5877816acd8cd23be68d8da5661d0931b17427/datasets/simple_extractor_dataset.py#L30

with:

allowed_image_extensions = [".png", ".jpg", ".jpeg", ".webm"]

self.file_list = list(
    filter(
        lambda f: sum(
            [f.lower().endswith(ext) for ext in allowed_image_extensions]
        )
        > 0,
        os.listdir(self.root),
    )
)

allowed_image_extensions can be a constructor parameter - that way users may choose what files to filter for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants