Package com.itextpdf.pdfocr.onnx
Class AbstractOnnxPredictorProperties
java.lang.Object
com.itextpdf.pdfocr.onnx.AbstractOnnxPredictorProperties
- Direct Known Subclasses:
-
OnnxDetectionPredictorProperties,OnnxOrientationPredictorProperties,OnnxRecognitionPredictorProperties
Properties for configuring ONNX models.
It contains a path to the model, model input properties and an ONNX runtime session options creator.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final IOrtSessionOptionsCreatorDefault ONNX runtime session options creator.protected final OnnxInputPropertiesProperties of the inputs of the ONNX model.protected final StringPath to the ONNX model to load.protected final IOrtSessionOptionsCreatorONNX runtime session options creator. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractOnnxPredictorProperties(String modelPath, OnnxInputProperties inputProperties, IOrtSessionOptionsCreator ortSessionOptionsCreator) Creates new predictor properties. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ONNX model input properties.Returns the path to the ONNX model.Returns the ONNX runtime session options creator.
-
Field Details
-
DEFAULT_ORT_SESSION_CREATOR
Default ONNX runtime session options creator. -
modelPath
Path to the ONNX model to load. -
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
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
Returns the ONNX runtime session options creator.- Returns:
- the ONNX runtime session options creator
-
getInputProperties
Returns the ONNX model input properties.- Returns:
- the ONNX model input properties
-
getModelPath
Returns the path to the ONNX model.- Returns:
- the path to the ONNX model
-