Package qupath.opencv.dnn
Class DnnModelParams
java.lang.Object
qupath.opencv.dnn.DnnModelParams
Parameters to build a
DnnModel
.
These are used via DnnModels.buildModel(DnnModelParams)
.
Many parameters are optional.
However as many as are available should be set, to maximize the chances
of a DnnModelBuilder
being available to build a model from the parameters.
Warning! The API for this class is unstable; it is likely to change in future releases.
- Since:
- v0.4.0
- Author:
- Pete Bankhead
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default name to identify MXNet.static final String
Default name to identify ONNX Runtime.static final String
Default name to identify OpenCV DNN.static final String
Default name to identify PyTorch.static final String
Default name to identify TensorFlow.static final String
Default name to identify TensorFlow Lite. -
Method Summary
Modifier and TypeMethodDescriptionstatic DnnModelParams.Builder
builder()
Create a new params builder, with default values.static DnnModelParams.Builder
builder
(DnnModelParams params) Create a new params builder, initialized with the values from existing params.Get the name of the deep learning framework that may be used.Get the requested inputs and their shapes.Get a string representing the axes layout that the model expects as input.Get the expected outputs and their shapes.getURIs()
Get the URIs associated with the model (e.g.boolean
Request that any model is loaded lazily on demand.
-
Field Details
-
FRAMEWORK_TENSORFLOW
Default name to identify TensorFlow.- See Also:
-
FRAMEWORK_TF_LITE
Default name to identify TensorFlow Lite.- See Also:
-
FRAMEWORK_ONNX_RUNTIME
Default name to identify ONNX Runtime.- See Also:
-
FRAMEWORK_OPENCV_DNN
Default name to identify OpenCV DNN.- See Also:
-
FRAMEWORK_PYTORCH
Default name to identify PyTorch.- See Also:
-
FRAMEWORK_MXNET
Default name to identify MXNet.- See Also:
-
-
Method Details
-
getFramework
Get the name of the deep learning framework that may be used. If null, consumers may try to infer this from any URIs.- Returns:
-
getURIs
Get the URIs associated with the model (e.g. weights and/or config files).- Returns:
-
getInputs
Get the requested inputs and their shapes.- Returns:
- the inputs, if known, or null otherwise
-
getOutputs
Get the expected outputs and their shapes.- Returns:
- the outputs, if known, or null otherwise
-
getLayout
Get a string representing the axes layout that the model expects as input. This should follow the Bioimage Model Zoo spec, and include only the characters "bixyczt".- Returns:
-
requestLazyInitialize
public boolean requestLazyInitialize()Request that any model is loaded lazily on demand.This can be useful to avoid blocking at some inopportune point in the code, but means that any exceptions associated with model initialization will probably not be thrown until the model is used.
- Returns:
-
builder
Create a new params builder, initialized with the values from existing params.- Parameters:
params
-- Returns:
- a new builder
-
builder
Create a new params builder, with default values.- Returns:
- a new builder
-