ModelABC#
tiatoolbox
.models
.models_abc
.ModelABC
- class ModelABC[source]#
Abstract base class for models used in tiatoolbox.
Methods
Torch method, this contains logic for using layers defined in init.
Run inference on an input batch.
Define the post-processing of this class of model.
Define the pre-processing of this class of model.
Attributes
Return the current post-processing function of this instance.
Return the current pre-processing function of this instance.
- abstract forward(*args, **kwargs)[source]#
Torch method, this contains logic for using layers defined in init.
- abstract static infer_batch(model, batch_data, on_gpu)[source]#
Run inference on an input batch.
Contains logic for forward operation as well as I/O aggregation.
- Parameters:
model (nn.Module) – PyTorch defined model.
batch_data (ndarray) – A batch of data generated by torch.utils.data.DataLoader.
on_gpu (bool) – Whether to run inference on a GPU.
- property postproc_func#
Return the current post-processing function of this instance.
- property preproc_func#
Return the current pre-processing function of this instance.