Wraps a segmentation / label mask, resampled with nearest mode.
Companion target for semantic / instance segmentation pipelines. Geometric transforms (flip / crop / resize / rotate) move the mask in lock-step with its image but always resample with nearest interpolation so class indices survive unblended; photometric transforms (colour-jitter, blur, ...) leave the mask untouched.
Parameters
dataTensorLabel / probability map with shape
(H, W), (C, H, W),
or (B, C, H, W). Integer dtypes are recommended for class
indices to preserve nearest-neighbour resampling exactly.Used by 3
Constructors
1Initialise the module and validate the supplied config.
Parameters
configModelConfigMust be an instance of the subclass's declared
config_class.Raises
TypeErrorIf
config_class has not been set on the concrete subclass,
or if config is not an instance of config_class.