Class ImageInferenceContext

Object
ImageInferenceContext

public final class ImageInferenceContext extends Object
Attributes describing the situation in which inference on images is occurring.

These may be helpful for decoding output from the inference.

Author:
Owen Feehan
  • Constructor Details

    • ImageInferenceContext

      public ImageInferenceContext(DualScale<Dimensions> dimensions, ScaleFactor scaleFactor, Optional<List<String>> classLabels, VoxelsResizer resizer, ExecutionTimeRecorder executionTimeRecorder, Logger logger)
      Creates a new ImageInferenceContext instance.
      Parameters:
      dimensions - The size of the image for which we wish to segment, before and after any scaling for model inference.
      scaleFactor - The inverse of the scaling-factor applied to reduce unscaledDimensions to the input-matrix used for inference.
      classLabels - If available, labels of classes loaded from a text file at classLabelsPath.
      resizer - How to resize images or voxel-buffers.
      executionTimeRecorder - Allows execution-time for particular operations to be recorded.
      logger - Where to log information messages during inference.
  • Method Details

    • scaleFactorUpscale

      public final DualScale<Optional<ScaleFactor>> scaleFactorUpscale()
      The scaling-factors needed to upscale the model output to match the desired scale.
      Returns:
      each scaling-factor (if required) to scale an image (at the respective scale in DualScale by, so they become identically sized to the DualScale.atInputScale().
    • getDimensions

      public DualScale<Dimensions> getDimensions()
      The size of the image for which we wish to segment, before and after any scaling for model inference.
    • getScaleFactor

      public ScaleFactor getScaleFactor()
      The inverse of the scaling-factor applied to reduce unscaledDimensions to the input-matrix used for inference.
    • getClassLabels

      public Optional<List<String>> getClassLabels()
      If available, labels of classes loaded from a text file at classLabelsPath.
    • getResizer

      public VoxelsResizer getResizer()
      How to resize images or voxel-buffers.
    • getExecutionTimeRecorder

      public ExecutionTimeRecorder getExecutionTimeRecorder()
      Allows execution-time for particular operations to be recorded.
    • getLogger

      public Logger getLogger()
      Where to log information messages during inference.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object