Module preprocessor.roi_input
Images used to train Region of Interest require more than simple named "target" information for training. Specifically, coordinates for the bounding box that defines a region associated with a target must also be defined.
Classes
class ROIPreprocessor (target_path_column: str, dtype: Optional[str])
-
Static methods
def builder() -> ROIPreprocessorBuilder
Instance variables
var target_path_column
Methods
def read_file(self, asset: Union[str, pathlib.Path, Package]) -> torch.utils.data.dataset.Dataset
class ROIPreprocessorBuilder
-
Abstract base for a preprocessor that can output data as a torch.dataset
Ancestors
Class variables
var SCHEMA
Methods
def dtype(self, dtype: Optional[str]) -> ROIPreprocessorBuilder
-
Cast an output numpy array to a given dtype. If unset, the Protocol will choose. Ignored for non numpy outputs.
Args
dtype
- The dtype that a numpy output will be cast into.
Returns
ROIPreprocessorBuilder
- This class instance, useful for chaining.
def target_path_column(self, column_name: str) -> ROIPreprocessorBuilder
-
Sets which column from the asset's record data to use as a target.
Args
column_name
- The name of the column to take as target information.
Returns
ROIPreprocessorBuilder
- This class instance, useful for chaining.
Inherited members
class ROITorchDataset (parent: ROIPreprocessor, asset: Package)
-
An abstract class representing a :class:
Dataset
.All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite :meth:
__getitem__
, supporting fetching a data sample for a given key. Subclasses could also optionally overwrite :meth:__len__
, which is expected to return the size of the dataset by many :class:~torch.utils.data.Sampler
implementations and the default options of :class:~torch.utils.data.DataLoader
. Subclasses could also optionally implement :meth:__getitems__
, for speedup batched samples loading. This method accepts list of indices of samples of batch and returns list of samples.Note
:class:
~torch.utils.data.DataLoader
by default constructs an index sampler that yields integral indices. To make it work with a map-style dataset with non-integral indices/keys, a custom sampler must be provided.Ancestors
- torch.utils.data.dataset.Dataset
- typing.Generic