Shortcuts

SemanticSegmentationData

class flash.image.segmentation.data.SemanticSegmentationData(train_dataset=None, val_dataset=None, test_dataset=None, predict_dataset=None, data_source=None, preprocess=None, postprocess=None, data_fetcher=None, val_split=None, batch_size=4, num_workers=0, sampler=None)[source]

Data module for semantic segmentation tasks.

classmethod from_folders(train_folder=None, train_target_folder=None, val_folder=None, val_target_folder=None, test_folder=None, test_target_folder=None, predict_folder=None, train_transform=None, val_transform=None, test_transform=None, predict_transform=None, data_fetcher=None, preprocess=None, val_split=None, batch_size=4, num_workers=0, num_classes=None, labels_map=None, **preprocess_kwargs)[source]

Creates a SemanticSegmentationData object from the given data folders and corresponding target folders.

Parameters
  • train_folder (Optional[str]) – The folder containing the train data.

  • train_target_folder (Optional[str]) – The folder containing the train targets (targets must have the same file name as their corresponding inputs).

  • val_folder (Optional[str]) – The folder containing the validation data.

  • val_target_folder (Optional[str]) – The folder containing the validation targets (targets must have the same file name as their corresponding inputs).

  • test_folder (Optional[str]) – The folder containing the test data.

  • test_target_folder (Optional[str]) – The folder containing the test targets (targets must have the same file name as their corresponding inputs).

  • predict_folder (Optional[str]) – The folder containing the predict data.

  • train_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during training which maps Preprocess hook names to callable transforms.

  • val_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during validation which maps Preprocess hook names to callable transforms.

  • test_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during testing which maps Preprocess hook names to callable transforms.

  • predict_transform (Optional[Dict[str, Callable]]) – The dictionary of transforms to use during predicting which maps Preprocess hook names to callable transforms.

  • data_fetcher (Optional[BaseDataFetcher]) – The BaseDataFetcher to pass to the DataModule.

  • preprocess (Optional[Preprocess]) – The Preprocess to pass to the DataModule. If None, cls.preprocess_cls will be constructed and used.

  • val_split (Optional[float]) – The val_split argument to pass to the DataModule.

  • batch_size (int) – The batch_size argument to pass to the DataModule.

  • num_workers (int) – The num_workers argument to pass to the DataModule.

  • num_classes (Optional[int]) – Number of classes within the segmentation mask.

  • labels_map (Optional[Dict[int, Tuple[int, int, int]]]) – Mapping between a class_id and its corresponding color.

  • preprocess_kwargs – Additional keyword arguments to use when constructing the preprocess. Will only be used if preprocess = None.

Return type

DataModule

Returns

The constructed data module.

Examples:

data_module = SemanticSegmentationData.from_folders(
    train_folder="train_folder",
    train_target_folder="train_masks",
)
set_block_viz_window(value)[source]

Setter method to switch on/off matplotlib to pop up windows.

Return type

None

Read the Docs v: latest
Versions
latest
stable
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.