Class OnnxOrientationPredictorProperties
java.lang.Object
com.itextpdf.pdfocr.onnx.AbstractOnnxPredictorProperties
com.itextpdf.pdfocr.onnx.orientation.OnnxOrientationPredictorProperties
Properties for configuring crop orientation ONNX models.
It contains a path to the model, model input properties and a model output mapper.
-
Field Summary
Fields inherited from class com.itextpdf.pdfocr.onnx.AbstractOnnxPredictorProperties
DEFAULT_ORT_SESSION_CREATOR, inputProperties, modelPath, ortSessionOptionsCreator -
Constructor Summary
ConstructorsConstructorDescriptionOnnxOrientationPredictorProperties(String modelPath, OnnxInputProperties inputProperties, IOutputLabelMapper<TextOrientation> outputMapper) Creates new crop orientation predictor properties.OnnxOrientationPredictorProperties(String modelPath, OnnxInputProperties inputProperties, IOutputLabelMapper<TextOrientation> outputMapper, IOrtSessionOptionsCreator ortSessionOptionsCreator) Creates new crop orientation predictor properties. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the ONNX model output mapper.inthashCode()mobileNetV3(String modelPath) Creates a new crop orientation properties object for existing pre-trained MobileNetV3 models, stored on disk.mobileNetV3(String modelPath, IOrtSessionOptionsCreator ortSessionOptionsCreator) Creates a new crop orientation properties object for existing pre-trained MobileNetV3 models, stored on disk.toString()Methods inherited from class com.itextpdf.pdfocr.onnx.AbstractOnnxPredictorProperties
getInputProperties, getModelPath, getOrtSessionOptionsCreator
-
Constructor Details
-
OnnxOrientationPredictorProperties
public OnnxOrientationPredictorProperties(String modelPath, OnnxInputProperties inputProperties, IOutputLabelMapper<TextOrientation> outputMapper) Creates new crop orientation predictor properties.- Parameters:
-
modelPath- path to the ONNX model to load -
inputProperties- ONNX model input properties -
outputMapper- ONNX model output mapper
-
OnnxOrientationPredictorProperties
public OnnxOrientationPredictorProperties(String modelPath, OnnxInputProperties inputProperties, IOutputLabelMapper<TextOrientation> outputMapper, IOrtSessionOptionsCreator ortSessionOptionsCreator) Creates new crop orientation predictor properties.- Parameters:
-
modelPath- path to the ONNX model to load -
inputProperties- ONNX model input properties -
outputMapper- ONNX model output mapper -
ortSessionOptionsCreator- ONNX runtime session options creator
-
-
Method Details
-
mobileNetV3
Creates a new crop orientation properties object for existing pre-trained MobileNetV3 models, stored on disk. This is the only crop orientation model architecture available in OnnxTR.This can be used to load the following models from OnnxTR:
- Parameters:
-
modelPath- path to the pre-trained model - Returns:
- a new crop orientation properties object for a MobileNetV3 model
-
mobileNetV3
public static OnnxOrientationPredictorProperties mobileNetV3(String modelPath, IOrtSessionOptionsCreator ortSessionOptionsCreator) Creates a new crop orientation properties object for existing pre-trained MobileNetV3 models, stored on disk. This is the only crop orientation model architecture available in OnnxTR.This can be used to load the following models from OnnxTR:
- Parameters:
-
modelPath- path to the pre-trained model -
ortSessionOptionsCreator- the ONNX runtime session options creator - Returns:
- a new crop orientation properties object for a MobileNetV3 model
-
getOutputMapper
Returns the ONNX model output mapper.- Returns:
- the ONNX model output mapper
-
hashCode
public int hashCode() -
equals
-
toString
-