delta.data.seg_weights¶
- delta.data.seg_weights(mask: ndarray[Any, dtype[uint8]], classweights: Tuple[float, float] = (1, 1), w0: float = 12, sigma: float = 2) ndarray[Any, dtype[float32]]¶
This function computes the weight map as described in the original U-Net paper to force the model to learn borders (Slow, best to run this offline before training)
- Parameters
- mask2D array
Training output segmentation mask.
- classweightstuple of 2 int/floats
Weights to apply to background, foreground. The default is (1,1)
- w0int or float, optional
Base weight to apply to smallest distance (1 pixel). The default is 12.
- sigmaint or float, optional
Exponential decay rate to apply to distance weights. The default is 2.
- Returns
- weightmap2D array
Weights map image.