Class DnnModelParams

java.lang.Object
qupath.opencv.dnn.DnnModelParams

public class DnnModelParams extends Object
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
  • Field Details

    • FRAMEWORK_TENSORFLOW

      public static final String FRAMEWORK_TENSORFLOW
      Default name to identify TensorFlow.
      See Also:
    • FRAMEWORK_TF_LITE

      public static final String FRAMEWORK_TF_LITE
      Default name to identify TensorFlow Lite.
      See Also:
    • FRAMEWORK_ONNX_RUNTIME

      public static final String FRAMEWORK_ONNX_RUNTIME
      Default name to identify ONNX Runtime.
      See Also:
    • FRAMEWORK_OPENCV_DNN

      public static final String FRAMEWORK_OPENCV_DNN
      Default name to identify OpenCV DNN.
      See Also:
    • FRAMEWORK_PYTORCH

      public static final String FRAMEWORK_PYTORCH
      Default name to identify PyTorch.
      See Also:
    • FRAMEWORK_MXNET

      public static final String FRAMEWORK_MXNET
      Default name to identify MXNet.
      See Also:
  • Method Details

    • getFramework

      public String 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

      public List<URI> getURIs()
      Get the URIs associated with the model (e.g. weights and/or config files).
      Returns:
    • getInputs

      public Map<String,DnnShape> getInputs()
      Get the requested inputs and their shapes.
      Returns:
      the inputs, if known, or null otherwise
    • getOutputs

      public Map<String,DnnShape> getOutputs()
      Get the expected outputs and their shapes.
      Returns:
      the outputs, if known, or null otherwise
    • getLayout

      public String 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

      public static DnnModelParams.Builder builder(DnnModelParams params)
      Create a new params builder, initialized with the values from existing params.
      Parameters:
      params -
      Returns:
      a new builder
    • builder

      public static DnnModelParams.Builder builder()
      Create a new params builder, with default values.
      Returns:
      a new builder