delta.data.trainGenerator_seg¶
- delta.data.trainGenerator_seg(batch_size: int, img_path: str, mask_path: str, weight_path: Optional[str], target_size: Tuple[int, int] = (256, 32), augment_params: Dict[str, Any] = {}, preload: bool = False, seed: int = 1, crop_windows: bool = False) Iterator[Tuple[ndarray[Any, dtype[float32]], ndarray[Any, dtype[float32]]]]¶
Generator for training the segmentation U-Net.
- Parameters
- batch_sizeint
Batch size, number of training samples to concatenate together.
- img_pathstring
Path to folder containing training input images.
- mask_pathstring
Path to folder containing training segmentation groundtruth.
- weight_pathstring or None.
Path to folder containing weight map images.
- target_sizetuple of 2 ints, optional
Input and output image size. The default is (256,32).
- augment_paramsdict, optional
Data augmentation parameters. See data_augmentation() doc for more info The default is {}.
- preloadbool, optional
Flag to load all training inputs in memory during intialization of the generator. The default is False.
- seedint, optional
Seed for numpy’s random generator. see numpy.random.seed() doc The default is 1.
- Yields
- image_arr4D numpy array of floats
Input images for the U-Net training routine. Dimensions of the tensor are (batch_size, target_size[0], target_size[1], 1)
- mask_wei_arr4D numpy array of floats
Output masks and weight maps for the U-Net training routine. Dimensions of the tensor are (batch_size, target_size[0], target_size[1], 2)