VOOZH about

URL: https://huggingface.co/itextresearch/itext-PP-OCRv5_mobile_det_infer

⇱ itextresearch/itext-PP-OCRv5_mobile_det_infer · Hugging Face


itext-PP-OCRv5_mobile_det_infer

These are machine learning models designed to detect and recognize text within images. They analyze visual input, identify regions containing text, and convert that text into a machine-readable format. We integrate these models into our iText PdfOCR ONNX engine to enable efficient and accurate extraction of textual content from scanned documents and image-based PDFs. For seamless integration, they are converted into ONNX format, ensuring compatibility with the iText PdfOCR engine.

Learn more about iText PdfOCR

Model overview

Getting started with iText pdfOCR


Simple OCR engine (detection + recognition)

java (but is also available in .NET)
// detection
IDetectionPredictor detection = OnnxDetectionPredictor.paddleOcr(PATH_TO_DETECTION_MODEL); // e.g. "PP-OCRv5_mobile_det_infer.onnx"
// recognition
IRecognitionPredictor recognition = OnnxRecognitionPredictor.paddleOcr(PATH_TO_RECOGNITION_MODEL); // your recognition ONNX model
// combine into an engine
try(OnnxOcrEngine ocrEngine = new OnnxOcrEngine(detection, recognition);) { 
 /* Your OCR processing here */ 
}

OCR engine with orientation handling

java (but is also available in .NET)
IDetectionPredictor detection = OnnxDetectionPredictor.paddleOcr(PATH_TO_DETECTION_MODEL);
IRecognitionPredictor recognition = OnnxRecognitionPredictor.paddleOcr(PATH_TO_RECOGNITION_MODEL);
// orientation predictor (MobileNetV3 variant)
OnnxOrientationPredictor orientation = OnnxOrientationPredictor.mobileNetV3(PATH_TO_ORIENTATION_MODEL);
OnnxOcrEngine ocrEngine = new OnnxOcrEngine(detection, orientation, recognition);
try(OnnxOcrEngine ocrEngine = new OnnxOcrEngine(detection, orientation, recognition)) { 
 /* Your OCR processing here */ 
}

The created ocrEngine can be passed to the standard iText pdfOCR API, e.g.:

OcrPdfCreator ocrPdfCreator = new OcrPdfCreator(ocrEngine);
ocrPdfCreator.createPdfFile(Collections.singletonList(new File(imagePath)), new File(outPdfFile))

Sample projects

The following example files illustrate complete usage patterns:
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support