🚀 UVDoc
UVDoc is a model that focuses on text image correction. It conducts geometric transformation on images to correct issues like document distortion, inclination, and perspective deformation, ensuring more accurate subsequent text recognition.
🚀 Quick Start
📦 Installation
1. PaddlePaddle
Refer to the following commands to install PaddlePaddle using pip:
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
For detailed PaddlePaddle installation instructions, refer to the PaddlePaddle official website.
2. PaddleOCR
Install the latest version of the PaddleOCR inference package from PyPI:
python -m pip install paddleocr
💻 Usage Examples
Basic Usage
You can quickly experience the functionality with a single command:
paddleocr text_image_unwarping --model_name UVDoc -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/SfMVKd0xnMII5KBDV6Mfz.jpeg
You can also integrate the model inference of the TextImageUnwarping module into your project. Before running the following code, download the sample image to your local machine.
from paddleocr import TextImageUnwarping
model = TextImageUnwarping(model_name="UVDoc")
output = model.predict("SfMVKd0xnMII5KBDV6Mfz.jpeg", batch_size=1)
for res in output:
res.print()
res.save_to_img(save_path="./output/")
res.save_to_json(save_path="./output/res.json")
After running, the obtained result is as follows:
{'res': {'input_path': 'doc_test.jpg', 'page_index': None, 'doctr_img': '...'}}
The visualized image is as follows:

For details about usage command and descriptions of parameters, refer to the Document.
Advanced Usage
The ability of a single model is limited. But the pipeline consists of several models can provide more capacity to resolve difficult problems in real-world scenarios.
PP-StructureV3
Layout analysis is a technique used to extract structured information from document images. PP-StructureV3 includes the following six modules:
- Layout Detection Module
- General OCR Sub-pipeline
- Document Image Preprocessing Sub-pipeline (Optional)
- Table Recognition Sub-pipeline (Optional)
- Seal Recognition Sub-pipeline (Optional)
- Formula Recognition Sub-pipeline (Optional)
You can quickly experience the PP-StructureV3 pipeline with a single command.
paddleocr pp_structurev3 --use_doc_unwarping True -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/KP10tiSZfAjMuwZUSLtRp.png
You can experience the inference of the pipeline with just a few lines of code. Taking the PP-StructureV3 pipeline as an example:
from paddleocr import PPStructureV3
pipeline = PPStructureV3(use_doc_unwarping=True)
output = pipeline.predict("./KP10tiSZfAjMuwZUSLtRp.png")
for res in output:
res.print()
res.save_to_json(save_path="output")
res.save_to_markdown(save_path="output")
For details about usage command and descriptions of parameters, refer to the Document.
📚 Documentation
Property |
Details |
Model Type |
UVDoc |
CER |
0.179 |
Note: Test data set: docunet benchmark data set.
📄 License
This project is licensed under the Apache-2.0 license.
🔗 Links