Class AbstractOnnxPredictorProperties

java.lang.Object
com.itextpdf.pdfocr.onnx.AbstractOnnxPredictorProperties
Direct Known Subclasses:
OnnxDetectionPredictorProperties, OnnxOrientationPredictorProperties, OnnxRecognitionPredictorProperties

public abstract class AbstractOnnxPredictorProperties extends Object
Properties for configuring ONNX models.

It contains a path to the model, model input properties and an ONNX runtime session options creator.

  • Field Details

    • DEFAULT_ORT_SESSION_CREATOR

      protected static final IOrtSessionOptionsCreator DEFAULT_ORT_SESSION_CREATOR
      Default ONNX runtime session options creator.
    • modelPath

      protected final String modelPath
      Path to the ONNX model to load.
    • inputProperties

      protected final OnnxInputProperties inputProperties
      Properties of the inputs of the ONNX model. Used for validation (both input and output, since output mask size is the same) and pre-processing.
    • ortSessionOptionsCreator

      protected final IOrtSessionOptionsCreator ortSessionOptionsCreator
      ONNX runtime session options creator.
  • Constructor Details

    • AbstractOnnxPredictorProperties

      public AbstractOnnxPredictorProperties (String modelPath, OnnxInputProperties inputProperties, IOrtSessionOptionsCreator ortSessionOptionsCreator)
      Creates new predictor properties.
      Parameters:
      modelPath - path to the ONNX model to load
      inputProperties - ONNX model input properties
      ortSessionOptionsCreator - ONNX runtime session options creator
  • Method Details

    • getOrtSessionOptionsCreator

      public IOrtSessionOptionsCreator getOrtSessionOptionsCreator()
      Returns the ONNX runtime session options creator.
      Returns:
      the ONNX runtime session options creator
    • getInputProperties

      public OnnxInputProperties getInputProperties()
      Returns the ONNX model input properties.
      Returns:
      the ONNX model input properties
    • getModelPath

      public String getModelPath()
      Returns the path to the ONNX model.
      Returns:
      the path to the ONNX model