IOPatchPredictorConfig¶
- class IOPatchPredictorConfig(input_resolutions, patch_input_shape, stride_shape=None, output_resolutions=<factory>)[source]¶
Contains patch predictor input and output information.
- Parameters:
input_resolutions (list(dict)) – Resolution of each input head of model inference, must be in the same order as target model.forward().
patch_input_shape (
numpy.ndarray, list(int), tuple(int)) – Shape of the largest input in (height, width).stride_shape (
numpy.ndarray, list(int), tuple(int)) – Stride in (x, y) direction for patch extraction.output_resolutions (list(dict)) – Resolution of each output head from model inference, must be in the same order as target model.infer_batch().
- input_resolutions¶
Resolution of each input head of model inference, must be in the same order as target model.forward().
- patch_input_shape¶
Shape of the largest input in (height, width).
- Type:
numpy.ndarray, list(int), tuple(int)
- stride_shape¶
Stride in (x, y) direction for patch extraction.
- Type:
numpy.ndarray, list(int), tuple(int)
- output_resolutions¶
Resolution of each output head from model inference, must be in the same order as target model.infer_batch().
- highest_input_resolution¶
Highest resolution to process the image based on input and output resolutions. This helps to read the image at the optimal resolution and improves performance.
- Type:
Examples
>>> # Defining io for a patch predictor network >>> ioconfig = IOPatchPredictorConfig( ... input_resolutions=[{"units": "mpp", "resolution": 0.5}], ... output_resolutions=[{"units": "mpp", "resolution": 0.5}], ... patch_input_shape=(224, 224), ... stride_shape=(224, 224), ... )
Methods
Attributes