PatchDatasetABC¶
tiatoolbox
.models
.dataset
.abc
.PatchDatasetABC
- class PatchDatasetABC[source]¶
Defines abstract base class for patch dataset.
- preproc_func¶
Preprocessing function used to transform the input data. If supplied, then torch.Compose will be used on the input preproc. preproc is a list of torchvision or custom transforms for preprocessing the image. The transforms will be applied in the order that they are given in the list. For more information, use the following link: https://pytorch.org/vision/stable/transforms.html.
Methods
Load an image from a provided path.
Define the pre-processing of this class of loader.
Attributes
Return the current pre-processing function of this instance.
- static load_img(path)[source]¶
Load an image from a provided path.
- Parameters
path (str) – Path to an image file.
- property preproc_func¶
Return the current pre-processing function of this instance.
The returned function is expected to behave as follows: >>> transformed_img = func(img)