public class OpenCVModel extends Object implements ImageInferenceModel<org.opencv.core.Mat>
Constructor and Description |
---|
OpenCVModel(org.opencv.dnn.Net model) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Indicates that the model will no longer be used, and does appropriate tidying up and freeing
of resources.
|
<S> S |
performInference(org.opencv.core.Mat input,
String inputName,
List<String> outputNames,
CheckedFunction<List<org.opencv.core.Mat>,S,OperationFailedException> convertFunction)
Performs inference on a single-input, to create an output.
|
public <S> S performInference(org.opencv.core.Mat input, String inputName, List<String> outputNames, CheckedFunction<List<org.opencv.core.Mat>,S,OperationFailedException> convertFunction) throws OperationFailedException
ImageInferenceModel
performInference
in interface ImageInferenceModel<org.opencv.core.Mat>
S
- the data-type the output is exposed as.input
- the input for inference.inputName
- the name associated with input
in the model.convertFunction
- converts the output to type <S>
.OperationFailedException
- if the inference cannot successfully complete.public void close()
InferenceModel
close
in interface AutoCloseable
close
in interface InferenceModel
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.