Class DefaultOrientationMapper
java.lang.Object
com.itextpdf.pdfocr.onnxtr.orientation.DefaultOrientationMapper
- All Implemented Interfaces:
-
IOutputLabelMapper<TextOrientation>
Default implementation for mapping output of a crop orientation model to
TextOrientation
values.
It expects the output to be an integer in the [0, 3] range, where the value specifies the amount of 90 degree rotations. Usually the model output would be a 4-element vector of probability-like values, which is then converted to an integer index via an argmax
function.
-
Constructor Details
-
DefaultOrientationMapper
public DefaultOrientationMapper()Constructs a newDefaultOrientationMapper
with default behavior. This constructor performs no initialization logic.
-
-
Method Details
-
size
public int size()Returns a number of mappable values.- Specified by:
-
size
in interfaceIOutputLabelMapper<TextOrientation>
- Returns:
- a number of mappable values
-
map
Returns value, which is mapped to the specified index.- Specified by:
-
map
in interfaceIOutputLabelMapper<TextOrientation>
- Parameters:
-
index
- index to map - Returns:
- mapped output value
-