Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

SemanticSegmentationFilesInput does not accept .npy files #1308

Closed
chris-clem opened this issue Apr 25, 2022 · 2 comments · Fixed by #1369
Closed

SemanticSegmentationFilesInput does not accept .npy files #1308

chris-clem opened this issue Apr 25, 2022 · 2 comments · Fixed by #1369
Assignees
Labels
bug / fix Something isn't working enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@chris-clem
Copy link

🐛 Bug

It seems that SemanticSegmentationFilesInput does not accept .npy files.

class SemanticSegmentationFilesInput(SemanticSegmentationInput):
    def load_data(
        self,
        files: Union[PATH_TYPE, List[PATH_TYPE]],
        mask_files: Optional[Union[PATH_TYPE, List[PATH_TYPE]]] = None,
        num_classes: Optional[int] = None,
        labels_map: Optional[Dict[int, Tuple[int, int, int]]] = None,
    ) -> List[Dict[str, Any]]:
        self.load_labels_map(num_classes, labels_map)
        if mask_files is None:
            files = filter_valid_files(files, valid_extensions=IMG_EXTENSIONS)
        else:
            files, mask_files = filter_valid_files(files, mask_files, valid_extensions=IMG_EXTENSIONS)
        return to_samples(files, mask_files)

files, mask_files = filter_valid_files(files, mask_files, valid_extensions=IMG_EXTENSIONS)
should be
files, mask_files = filter_valid_files(files, mask_files, valid_extensions=IMG_EXTENSIONS + NP_EXTENSIONS) ?

@chris-clem chris-clem added bug / fix Something isn't working help wanted Extra attention is needed labels Apr 25, 2022
@krshrimali
Copy link
Contributor

Hi, @chris-clem - Thank you for creating this issue! Could you please share a sample npy file with us? I would love to consider this if it's not supported already!

Also, yes, I agree that they should be supported. Maybe we just didn't have anyone demanding this, so we went with the image extensions initially. :)

@krshrimali krshrimali added the enhancement New feature or request label Apr 25, 2022
@Borda
Copy link
Member

Borda commented Apr 25, 2022

@chris-clem mind sending a quick PR?

@Borda Borda added this to the 0.7.x milestone May 17, 2022
@krshrimali krshrimali self-assigned this Jun 29, 2022
@ethanwharris ethanwharris modified the milestones: 0.7.x, 0.8.0 Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug / fix Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants