Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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