Interface ImageInferenceModel<T>
- Type Parameters:
T
- tensor-type that is both inputted to (representing an image), and outputted from the model during inference.
- All Superinterfaces:
AutoCloseable
,InferenceModel
- All Known Implementing Classes:
OnnxModel
,OpenCVModel
A model used for inference that accepts an image as an input.
A model should always be closed, when it is no longer in use.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescription<S> S
performInference
(T input, String inputName, List<String> outputIdentifiers, CheckedFunction<List<T>, S, OperationFailedException> convertOutput) Performs inference on a single-input, to create an output.Methods inherited from interface org.anchoranalysis.inference.InferenceModel
close
-
Method Details
-
performInference
<S> S performInference(T input, String inputName, List<String> outputIdentifiers, CheckedFunction<List<T>, S, throws OperationFailedExceptionOperationFailedException> convertOutput) Performs inference on a single-input, to create an output.- Type Parameters:
S
- the data-type the output is exposed as.- Parameters:
input
- the input for inference.inputName
- the name associated withinput
in the model.outputIdentifiers
-convertOutput
- converts the output to type<S>
.- Returns:
- the converted output.
- Throws:
OperationFailedException
- if the inference cannot successfully complete.
-