Self-Correction-Human-Parsing
Self-Correction-Human-Parsing copied to clipboard
feat: input files check (filter the unreadable files)
fix the issue #37
@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.