Interface PredictionFunction<T>
- Type Parameters:
- T-
The primary intention of this interface is to provide a means to integrate machine learning libraries into existing QuPath pipelines that use OpenCV for processing (e.g. object or pixel classification).
Note that, where possible, implementations should support JSON serialization via Gson if they are intended to support serialization.
- See Also:
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionGet the required inputs.getOutputs(DnnShape... inputShapes) Get the output names mapped to the output shapes.Call a function that takes one or more inputs to produce zero or more outputs.Call a function that takes a single input and provides a single output.
- 
Field Details- 
DEFAULT_INPUT_NAMEDefault name to use for single input.- See Also:
 
- 
DEFAULT_OUTPUT_NAMEDefault name to use for single output.- See Also:
 
 
- 
- 
Method Details- 
predictCall a function that takes one or more inputs to produce zero or more outputs.- Parameters:
- input- map of input names and blobs
- Returns:
- map of output names and blobs
- Implementation Note
- The default implementation supports only a single input, passing it (regardless of name) to
           predict(Object). It returns either an empty map, or a map with a single entry named "output".
 
- 
predictCall a function that takes a single input and provides a single output.- Parameters:
- input- input to the function
- Returns:
- output of the function
 
- 
getInputsGet the required inputs.Often, this is a singleton map with key DEFAULT_INPUT_NAMEfor functions that take a single input.If the shape is known, the axis order is typically NCHW. NCHW is used by OpenCV https://docs.opencv.org/4.5.2/d6/d0f/group__dnn.html#ga29f34df9376379a603acd8df581ac8d7 and also by PyTorch; for TensorFlow some rearrangement may be needed. - Returns:
 
- 
getOutputsGet the output names mapped to the output shapes.Often, this is a singleton map with key DEFAULT_OUTPUT_NAMEfor functions that provide a single output.- Parameters:
- inputShapes- optional input shapes; if not provided, the output shapes are generally- DnnShape.UNKNOWN_SHAPE
- Returns:
 
 
-