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

Support targets file names with different file extension than x file names #1129

Closed
AlexandreBrown opened this issue Jan 19, 2022 · 0 comments · Fixed by #1130
Closed

Support targets file names with different file extension than x file names #1129

AlexandreBrown opened this issue Jan 19, 2022 · 0 comments · Fixed by #1130
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@AlexandreBrown
Copy link

AlexandreBrown commented Jan 19, 2022

🚀 Feature

The feature consists in supporting the use case where we have train/val/test images with an extension and train/val/test targets with a different extension.

eg:

train_folder

  • File extension : .jpg

train_target_folder

  • File extension : .tiff

val_folder

  • File extension : .jpg

val_target_folder

  • File extension : .tiff

Motivation

This is a common use case that should be supported in order to open Lightning Flash to a broader audience.
This also reduces the barrier to try out Flash by eliminating the need to convert your data to a matching file extension.

Currently this is not supported if your target file paths have a different file extension than the X file paths :

data_module = SemanticSegmentationData.from_folders(
    train_folder=train_images.path,
    train_target_folder=train_masks.path,
    val_folder=valid_images.path,
    val_target_folder=valid_masks.path,
    num_classes=number_of_classes,
    batch_size=batch_size
)

Actual Outcome : ValueError: not enough values to unpack (expected 2, got 0)
Expected Outcome : No error message and it works

Additional context

See slack discussion that led to this issue https://pytorch-lightning.slack.com/archives/CRBLFHY79/p1642626657155300

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant