lazyslide_models.base.DensePredictionModel#
- class DensePredictionModel#
Bases:
ModelBaseBase class for models returning one value per pixel.
predictshould return the model’s final, post-activation output. Whatever activation the model was trained with is applied insidepredict, so a caller never applies one.- Attributes:
- output_mppfloat, optional
Resolution of the output.
Nonemeans the output lands on the input tile’s own grid, which is the common case; set it when the model predicts onto a coarser or finer grid than it was given.- output_rangetuple of float, optional
(low, high)bounds the post-activation values fall within, so a runner can pick a storage dtype instead of defaulting to float32.Nonemeans unbounded, which is also what a model with a linear output head should declare.
- abstractmethod predict(image)#
Predict from a
[B, C, H, W]tile batch.Returns a float tensor of shape
[B, C, H, W], already activated and withinoutput_rangewhen that is declared.