Skip to content

Commit e83596d

Browse files
committed
Remove TODOs to DEVSIX-9153
1 parent cd65d6a commit e83596d

3 files changed

Lines changed: 5 additions & 11 deletions

File tree

pdfocr-api/src/main/java/com/itextpdf/pdfocr/TextInfo.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ public class TextInfo {
4040

4141
/**
4242
* {@link Rectangle} describing text bbox (lower-left based) expressed in points.
43-
*
44-
* <p>
45-
* TODO DEVSIX-9153: mark this on breaking changes page. Why not return rectangles in image pixels?
46-
* Seems odd, that an OCR engine should be concerned by PDF specific. It would make sense for an engine
47-
* to return results, which could be directly applied to images inputs instead.
4843
*/
4944
private Rectangle bboxRect;
5045

pdfocr-onnxtr/src/main/java/com/itextpdf/pdfocr/onnxtr/OnnxTrProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ Map<Integer, List<TextInfo>> doOcr(List<BufferedImage> images, OcrProcessContext
9393
eventHelper.getSequenceId(), null, eventHelper.getConfirmationType());
9494
eventHelper.onEvent(event);
9595
/*
96-
* TODO DEVSIX-9153: Potential performance improvement (at least for GPU).
96+
* Potential performance improvement (at least for GPU).
9797
*
9898
* There is a potential for performance improvements here. Currently, this mirrors the
9999
* behavior in OnnxTR/DocTR, where inputs for orientation and recognition models are
100100
* aggregated per input image.
101101
*
102102
* But, most of the time, this will not be enough to saturate the batch size fully.
103103
* Ideally, we should process all text boxes together, regardless of the origin image,
104-
* and then separate the results afterwards.
104+
* and then separate the results afterward.
105105
*/
106106
BufferedImage image = images.get(imageIndex);
107107
List<Point[]> textBoxes = textBoxGenerator.next();

pdfocr-onnxtr/src/main/java/com/itextpdf/pdfocr/onnxtr/detection/OnnxDetectionPostProcessor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,9 @@ public List<Point[]> process(BufferedImage input, FloatBufferMdArray output) {
9292
final int height = output.getDimension(1);
9393
final int width = output.getDimension(2);
9494
final List<Point[]> boxes = new ArrayList<>();
95-
// TODO DEVSIX-9153: Ideally we would want to either cache the score mask (as model
96-
// dimensions won't change) or use a smaller mask with only the
97-
// contour. Though based on profiling, it doesn't look like it is
98-
// that bad, when it is only once per input image.
95+
// Ideally we would want to either cache the score mask (as model dimensions won't change)
96+
// or use a smaller mask with only the contour. Though based on profiling, it doesn't look
97+
// like it is that bad, when it is only once per input image.
9998
try (final Mat scoreMask = new Mat(height, width, CvType.CV_8U, new Scalar(0));
10099
final MatVector contours = findTextContours(output, binarizationThreshold)) {
101100
final long contourCount = contours.size();

0 commit comments

Comments
 (0)