add PPv6 model
Browse files- .gitignore +1 -1
- PPv6/PP-OCRv6_medium_det_safetensors/README.md +188 -0
- PPv6/PP-OCRv6_medium_det_safetensors/config.json +59 -0
- PPv6/PP-OCRv6_medium_det_safetensors/inference.yml +52 -0
- PPv6/PP-OCRv6_medium_det_safetensors/model.safetensors +3 -0
- PPv6/PP-OCRv6_medium_det_safetensors/preprocessor_config.json +34 -0
- PPv6/PP-OCRv6_medium_rec_safetensors/README.md +200 -0
- PPv6/PP-OCRv6_medium_rec_safetensors/config.json +38 -0
- PPv6/PP-OCRv6_medium_rec_safetensors/inference.yml +0 -0
- PPv6/PP-OCRv6_medium_rec_safetensors/model.safetensors +3 -0
- PPv6/PP-OCRv6_medium_rec_safetensors/preprocessor_config.json +0 -0
- main_v6.py +1 -0
.gitignore
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
.venv/
|
| 2 |
-
PPv6/
|
| 3 |
out.json
|
| 4 |
.vscode/settings.json
|
|
|
|
| 1 |
.venv/
|
| 2 |
+
#PPv6/
|
| 3 |
out.json
|
| 4 |
.vscode/settings.json
|
PPv6/PP-OCRv6_medium_det_safetensors/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: PaddleOCR
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- zh
|
| 7 |
+
pipeline_tag: image-to-text
|
| 8 |
+
tags:
|
| 9 |
+
- OCR
|
| 10 |
+
- PaddlePaddle
|
| 11 |
+
- PaddleOCR
|
| 12 |
+
- textline_detection
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<div align="center">
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
<h1 align="center">
|
| 19 |
+
|
| 20 |
+
PP-OCRv6: From 1.5M to 34.5M Parameters, Surpassing Billion-Scale VLMs on OCR Tasks
|
| 21 |
+
|
| 22 |
+
</h1>
|
| 23 |
+
|
| 24 |
+
[](https://github.com/PaddlePaddle/PaddleOCR)
|
| 25 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_det_safetensors)
|
| 26 |
+
[](https://x.com/PaddlePaddle)
|
| 27 |
+
[](./LICENSE)
|
| 28 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_det)
|
| 29 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_det_onnx)
|
| 30 |
+
|
| 31 |
+
**🔥 [Official Website](https://www.paddleocr.com)**
|
| 32 |
+
**📝 [Technical Report](https://arxiv.org/pdf/2606.13108)**
|
| 33 |
+
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<div align="center">
|
| 37 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/684ba591e717a30275a1b76a/0XIrg0UmmOvplnPjmsmK3.png" width="800"/>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
## PP-OCRv6 Overview
|
| 41 |
+
|
| 42 |
+
PP-OCRv6 is a lightweight OCR system that combines architectural innovation with data-centric optimization. It redesigns the backbone, detection neck, and recognition neck around a unified MetaFormer-style building block with structural reparameterization. Three model tiers (medium, small, tiny) share the same block primitives, covering deployment scenarios from server to edge.
|
| 43 |
+
|
| 44 |
+
### Key Features
|
| 45 |
+
|
| 46 |
+
1. **Unified and Scalable Model Family:** A three-tier OCR model family spanning 1.5M to 34.5M parameters. PP-OCRv6_medium achieves 86.2% detection Hmean and 83.2% recognition accuracy, outperforming PP-OCRv5_server by +4.6% and +5.1% respectively.
|
| 47 |
+
|
| 48 |
+
2. **Lightweight Architectural Innovations:** (i) LCNetV4, a MetaFormer-style lightweight backbone with structural reparameterization; (ii) RepLKFPN, a detection neck with dilated reparameterizable depthwise convolutions; (iii) EncoderWithLightSVTR, a recognition neck with local-global attention and additive skip connections.
|
| 49 |
+
|
| 50 |
+
3. **Multi-Language and Scenario Support:** Supports 48 languages and diverse industrial scenes (digital displays, dot-matrix characters, tire prints, etc.), surpassing Qwen3-VL-235B, GPT-5.5, and Gemini-3.1-Pro with orders of magnitude fewer parameters.
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
# PP-OCRv6_medium_det
|
| 54 |
+
|
| 55 |
+
## Introduction
|
| 56 |
+
|
| 57 |
+
<div align="center">
|
| 58 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/684ba591e717a30275a1b76a/ofnSGExgJL6K6d8ghh0vl.png" width="600"/>
|
| 59 |
+
|
| 60 |
+
PP-OCRv6 text detection architecture overview
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
PP-OCRv6_medium_det is the largest model in the PP-OCRv6 detection series developed by the PaddleOCR team. It uses LCNetV4 as the backbone and RepLKFPN as the feature pyramid neck, providing accurate text localization across diverse scenarios including handwritten, printed, rotated, curved, and artistic text in multiple languages. The model contains 15.5M parameters. The key accuracy metrics are as follows:
|
| 64 |
+
|
| 65 |
+
| Model | Average | Handwritten CN | Handwritten EN | Printed CN | Printed EN | Traditional Chinese | Ancient Text | Japanese | Blur | Emoji | Warp | Pinyin | Artistic | Table | Rotation | Industrial | General |
|
| 66 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 67 |
+
| Gemini-3.1-Pro | 46.8 | 53.4 | 56.5 | 47.3 | 47.6 | 39.0 | 45.8 | 38.2 | 50.0 | 68.1 | 44.6 | 40.6 | 65.2 | 26.9 | 22.1 | 52.5 | 50.2 |
|
| 68 |
+
| GPT-5.5 | 45.6 | 42.4 | 58.5 | 50.2 | 51.9 | 35.0 | 26.7 | 42.0 | 49.1 | 97.5 | 37.7 | 36.3 | 52.0 | 71.0 | 10.0 | 36.2 | 32.6 |
|
| 69 |
+
| Qwen3-VL-235B | 38.3 | 56.5 | 66.0 | 41.7 | 37.0 | 19.3 | 13.1 | 27.0 | 38.5 | 81.2 | 28.5 | 33.0 | 68.3 | 19.6 | 2.1 | 48.4 | 32.3 |
|
| 70 |
+
| Kimi-K2.6 | 12.8 | 12.5 | 25.5 | 10.1 | 18.5 | 8.2 | 7.5 | 11.2 | 16.9 | 28.9 | 13.9 | 6.8 | 16.1 | 10.9 | 0.8 | 6.3 | 10.9 |
|
| 71 |
+
| MiniMax-M3 | 12.0 | 13.7 | 19.3 | 9.8 | 14.1 | 7.7 | 11.1 | 10.6 | 16.1 | 32.8 | 12.8 | 8.5 | 16.6 | 5.5 | 0.1 | 6.4 | 6.4 |
|
| 72 |
+
| PP-OCRv5_server | 81.6 | 80.3 | 84.1 | 94.5 | 91.7 | 81.5 | 67.6 | 77.2 | 90.1 | 96.2 | 87.6 | 67.1 | 67.3 | 97.1 | 80.0 | 64.3 | 79.7 |
|
| 73 |
+
| PP-OCRv5_mobile | 75.2 | 74.4 | 77.7 | 90.5 | 91.0 | 82.3 | 58.1 | 72.7 | 87.4 | 93.6 | 82.7 | 57.5 | 52.5 | 92.8 | 64.7 | 52.8 | 72.1 |
|
| 74 |
+
| **PP-OCRv6_medium** | **86.2** | **83.7** | **84.0** | **95.1** | **93.7** | **86.3** | **80.2** | **84.3** | **94.1** | **99.6** | **88.6** | **74.0** | **69.0** | **96.8** | **93.8** | **73.3** | **82.8** |
|
| 75 |
+
| PP-OCRv6_small | 84.1 | 80.5 | 87.1 | 94.2 | 93.6 | 85.7 | 72.6 | 82.3 | 92.6 | 99.7 | 87.6 | 69.6 | 65.3 | 95.6 | 93.7 | 67.6 | 78.2 |
|
| 76 |
+
| PP-OCRv6_tiny | 80.6 | 79.4 | 85.9 | 93.1 | 92.3 | 83.7 | 63.0 | 76.6 | 89.3 | 99.8 | 86.1 | 59.0 | 60.1 | 94.7 | 91.0 | 62.0 | 73.8 |
|
| 77 |
+
|
| 78 |
+
## Quick Start
|
| 79 |
+
|
| 80 |
+
### Installation
|
| 81 |
+
|
| 82 |
+
1. PaddleOCR
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
# Install the basic version
|
| 86 |
+
pip install paddleocr
|
| 87 |
+
|
| 88 |
+
# Install the full version (includes all features)
|
| 89 |
+
pip install "paddleocr[all]"
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
2. Transformers environment (required for safetensors models)
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
pip install transformers torch
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### Model Usage
|
| 99 |
+
|
| 100 |
+
You can quickly experience the functionality with a single command:
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
paddleocr text_detection \
|
| 104 |
+
--model_name PP-OCRv6_medium_det \
|
| 105 |
+
--engine transformers \
|
| 106 |
+
-i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/3ul2Rq4Sk5Cn-l69D695U.png
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
You can also integrate the model inference of the text detection module into your project. Before running the following code, please download the sample image to your local machine.
|
| 110 |
+
|
| 111 |
+
```python
|
| 112 |
+
from paddleocr import TextDetection
|
| 113 |
+
model = TextDetection(model_name="PP-OCRv6_medium_det", engine="transformers")
|
| 114 |
+
output = model.predict(input="3ul2Rq4Sk5Cn-l69D695U.png", batch_size=1)
|
| 115 |
+
for res in output:
|
| 116 |
+
res.print()
|
| 117 |
+
res.save_to_img(save_path="./output/")
|
| 118 |
+
res.save_to_json(save_path="./output/res.json")
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
<!-- TODO: Update document links to PP-OCRv6 official documentation when available -->
|
| 122 |
+
For details about usage command and descriptions of parameters, please refer to the [Document](https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/text_detection.html#iii-quick-start).
|
| 123 |
+
|
| 124 |
+
### Pipeline Usage
|
| 125 |
+
|
| 126 |
+
The general OCR pipeline extracts text information from images. The pipeline consists of several modules:
|
| 127 |
+
* Document Image Orientation Classification Module (Optional)
|
| 128 |
+
* Text Image Unwarping Module (Optional)
|
| 129 |
+
* Text Line Orientation Classification Module (Optional)
|
| 130 |
+
* Text Detection Module
|
| 131 |
+
* Text Recognition Module
|
| 132 |
+
|
| 133 |
+
Run a single command to quickly experience the OCR pipeline:
|
| 134 |
+
|
| 135 |
+
```bash
|
| 136 |
+
paddleocr ocr -i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/3ul2Rq4Sk5Cn-l69D695U.png \
|
| 137 |
+
--text_detection_model_name PP-OCRv6_medium_det \
|
| 138 |
+
--text_recognition_model_name PP-OCRv6_medium_rec \
|
| 139 |
+
--engine transformers \
|
| 140 |
+
--use_doc_orientation_classify False \
|
| 141 |
+
--use_doc_unwarping False \
|
| 142 |
+
--use_textline_orientation True \
|
| 143 |
+
--save_path ./output \
|
| 144 |
+
--device gpu:0
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
For project integration:
|
| 148 |
+
|
| 149 |
+
```python
|
| 150 |
+
from paddleocr import PaddleOCR
|
| 151 |
+
|
| 152 |
+
ocr = PaddleOCR(
|
| 153 |
+
text_detection_model_name="PP-OCRv6_medium_det",
|
| 154 |
+
text_recognition_model_name="PP-OCRv6_medium_rec",
|
| 155 |
+
engine="transformers",
|
| 156 |
+
use_doc_orientation_classify=False,
|
| 157 |
+
use_doc_unwarping=False,
|
| 158 |
+
use_textline_orientation=False,
|
| 159 |
+
)
|
| 160 |
+
result = ocr.predict("./3ul2Rq4Sk5Cn-l69D695U.png")
|
| 161 |
+
for res in result:
|
| 162 |
+
res.print()
|
| 163 |
+
res.save_to_img("output")
|
| 164 |
+
res.save_to_json("output")
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
<!-- TODO: Update document links to PP-OCRv6 official documentation when available -->
|
| 168 |
+
For details about usage command and descriptions of parameters, please refer to the [Document](https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/pipeline_usage/OCR.html#2-quick-start).
|
| 169 |
+
|
| 170 |
+
## Links
|
| 171 |
+
|
| 172 |
+
[PaddleOCR Repo](https://github.com/paddlepaddle/paddleocr)
|
| 173 |
+
|
| 174 |
+
[PaddleOCR Documentation](https://paddlepaddle.github.io/PaddleOCR/latest/en/index.html)
|
| 175 |
+
|
| 176 |
+
## Citation
|
| 177 |
+
|
| 178 |
+
```bibtex
|
| 179 |
+
@misc{zhang2026ppocrv6,
|
| 180 |
+
title={PP-OCRv6: From 1.5M to 34.5M Parameters, Surpassing Billion-Scale VLMs on OCR Tasks},
|
| 181 |
+
author={Yubo Zhang and Xueqing Wang and Manhui Lin and Yue Zhang and Penglongyi Deng and Ting Sun and Tingquan Gao and Zelun Zhang and Jiaxuan Liu and Changda Zhou and Hongen Liu and Suyin Liang and Cheng Cui and Yi Liu and Dianhai Yu and Yanjun Ma},
|
| 182 |
+
year={2026},
|
| 183 |
+
eprint={2606.13108},
|
| 184 |
+
archivePrefix={arXiv},
|
| 185 |
+
primaryClass={cs.CV},
|
| 186 |
+
url={https://arxiv.org/abs/2606.13108},
|
| 187 |
+
}
|
| 188 |
+
```
|
PPv6/PP-OCRv6_medium_det_safetensors/config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "pp_ocrv6_medium_det",
|
| 3 |
+
"mode": "large",
|
| 4 |
+
"upsample_mode": "nearest",
|
| 5 |
+
"upsample_align_mode": 1,
|
| 6 |
+
"backbone_config": {
|
| 7 |
+
"model_type": "pp_lcnet_v4",
|
| 8 |
+
"stem_channels": [3, 64, 128],
|
| 9 |
+
"stem_type": "large",
|
| 10 |
+
"out_features": ["stage1", "stage2", "stage3", "stage4"],
|
| 11 |
+
"out_indices": [1, 2, 3, 4],
|
| 12 |
+
"block_configs": [
|
| 13 |
+
[[3, 128, 128, 1, true], [3, 128, 128, 1, false]],
|
| 14 |
+
[
|
| 15 |
+
[3, 128, 256, 2, false],
|
| 16 |
+
[3, 256, 256, 1, true],
|
| 17 |
+
[3, 256, 256, 1, false]
|
| 18 |
+
],
|
| 19 |
+
[
|
| 20 |
+
[3, 256, 512, 2, false],
|
| 21 |
+
[3, 512, 512, 1, true],
|
| 22 |
+
[3, 512, 512, 1, false],
|
| 23 |
+
[3, 512, 512, 1, true],
|
| 24 |
+
[3, 512, 512, 1, false]
|
| 25 |
+
],
|
| 26 |
+
[
|
| 27 |
+
[3, 512, 896, 2, false],
|
| 28 |
+
[3, 896, 896, 1, true],
|
| 29 |
+
[3, 896, 896, 1, false]
|
| 30 |
+
]
|
| 31 |
+
]
|
| 32 |
+
},
|
| 33 |
+
"use_lab": false,
|
| 34 |
+
"use_last_conv": true,
|
| 35 |
+
"class_expand": 2048,
|
| 36 |
+
"class_num": 1000,
|
| 37 |
+
"out_indices": [0, 1, 2, 3],
|
| 38 |
+
"neck_out_channels": 256,
|
| 39 |
+
"reduce_factor": 2,
|
| 40 |
+
"intraclass_block_number": 4,
|
| 41 |
+
"intraclass_block_config": {
|
| 42 |
+
"reduce_channel": [1, 1, 0],
|
| 43 |
+
"return_channel": [1, 1, 0],
|
| 44 |
+
"vertical_long_to_small_conv_longratio": [[7, 1], [1, 1], [3, 0]],
|
| 45 |
+
"vertical_long_to_small_conv_midratio": [[5, 1], [1, 1], [2, 0]],
|
| 46 |
+
"vertical_long_to_small_conv_shortratio": [[3, 1], [1, 1], [1, 0]],
|
| 47 |
+
"horizontal_small_to_long_conv_longratio": [[1, 7], [1, 1], [0, 3]],
|
| 48 |
+
"horizontal_small_to_long_conv_midratio": [[1, 5], [1, 1], [0, 2]],
|
| 49 |
+
"horizontal_small_to_long_conv_shortratio": [[1, 3], [1, 1], [0, 1]],
|
| 50 |
+
"symmetric_conv_long_longratio": [[7, 7], [1, 1], [3, 3]],
|
| 51 |
+
"symmetric_conv_long_midratio": [[5, 5], [1, 1], [2, 2]],
|
| 52 |
+
"symmetric_conv_long_shortratio": [[3, 3], [1, 1], [1, 1]]
|
| 53 |
+
},
|
| 54 |
+
"head_in_channels": 1024,
|
| 55 |
+
"scale_factor": 2,
|
| 56 |
+
"scale_factor_list": [1, 2, 4, 8],
|
| 57 |
+
"hidden_act": "relu",
|
| 58 |
+
"kernel_list": [3, 2, 2]
|
| 59 |
+
}
|
PPv6/PP-OCRv6_medium_det_safetensors/inference.yml
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Global:
|
| 2 |
+
model_name: PP-OCRv6_medium_det
|
| 3 |
+
Hpi:
|
| 4 |
+
backend_configs:
|
| 5 |
+
paddle_infer:
|
| 6 |
+
trt_dynamic_shapes: &id001
|
| 7 |
+
x:
|
| 8 |
+
- - 1
|
| 9 |
+
- 3
|
| 10 |
+
- 32
|
| 11 |
+
- 32
|
| 12 |
+
- - 1
|
| 13 |
+
- 3
|
| 14 |
+
- 736
|
| 15 |
+
- 736
|
| 16 |
+
- - 1
|
| 17 |
+
- 3
|
| 18 |
+
- 4000
|
| 19 |
+
- 4000
|
| 20 |
+
tensorrt:
|
| 21 |
+
dynamic_shapes: *id001
|
| 22 |
+
PostProcess:
|
| 23 |
+
box_thresh: 0.45
|
| 24 |
+
max_candidates: 3000
|
| 25 |
+
name: DBPostProcess
|
| 26 |
+
thresh: 0.2
|
| 27 |
+
unclip_ratio: 1.4
|
| 28 |
+
PreProcess:
|
| 29 |
+
transform_ops:
|
| 30 |
+
- DecodeImage:
|
| 31 |
+
channel_first: false
|
| 32 |
+
img_mode: BGR
|
| 33 |
+
- DetLabelEncode: null
|
| 34 |
+
- DetResizeForTest: null
|
| 35 |
+
- NormalizeImage:
|
| 36 |
+
mean:
|
| 37 |
+
- 0.485
|
| 38 |
+
- 0.456
|
| 39 |
+
- 0.406
|
| 40 |
+
order: hwc
|
| 41 |
+
scale: 1./255.
|
| 42 |
+
std:
|
| 43 |
+
- 0.229
|
| 44 |
+
- 0.224
|
| 45 |
+
- 0.225
|
| 46 |
+
- ToCHWImage: null
|
| 47 |
+
- KeepKeys:
|
| 48 |
+
keep_keys:
|
| 49 |
+
- image
|
| 50 |
+
- shape
|
| 51 |
+
- polys
|
| 52 |
+
- ignore_tags
|
PPv6/PP-OCRv6_medium_det_safetensors/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd393266c02e1a680b1b34c301d5d0d81e6290440b7f8ab0f5d5032276b17eb1
|
| 3 |
+
size 88020412
|
PPv6/PP-OCRv6_medium_det_safetensors/preprocessor_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_valid_processor_keys": [
|
| 3 |
+
"images",
|
| 4 |
+
"do_resize",
|
| 5 |
+
"size",
|
| 6 |
+
"resample",
|
| 7 |
+
"do_rescale",
|
| 8 |
+
"rescale_factor",
|
| 9 |
+
"do_normalize",
|
| 10 |
+
"image_mean",
|
| 11 |
+
"image_std",
|
| 12 |
+
"return_tensors",
|
| 13 |
+
"data_format",
|
| 14 |
+
"input_data_format"
|
| 15 |
+
],
|
| 16 |
+
"do_convert_rgb": true,
|
| 17 |
+
"do_normalize": true,
|
| 18 |
+
"do_rescale": true,
|
| 19 |
+
"do_resize": true,
|
| 20 |
+
"image_processor_type": "PPOCRV5ServerDetImageProcessor",
|
| 21 |
+
"model_input_names": ["pixel_values", "original_image_size"],
|
| 22 |
+
"image_mode": "BGR",
|
| 23 |
+
"channel_first": false,
|
| 24 |
+
"limit_side_len": 736,
|
| 25 |
+
"limit_type": "min",
|
| 26 |
+
"max_side_limit": 4000,
|
| 27 |
+
"image_mean": [0.406, 0.456, 0.485],
|
| 28 |
+
"image_std": [0.225, 0.224, 0.229],
|
| 29 |
+
"rescale_factor": 0.00392156862745098,
|
| 30 |
+
"resample": 2,
|
| 31 |
+
"normalize_order": "hwc",
|
| 32 |
+
"do_to_chw": true,
|
| 33 |
+
"keep_keys": ["image", "shape", "polys", "ignore_tags"]
|
| 34 |
+
}
|
PPv6/PP-OCRv6_medium_rec_safetensors/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: PaddleOCR
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
- zh
|
| 7 |
+
pipeline_tag: image-to-text
|
| 8 |
+
tags:
|
| 9 |
+
- OCR
|
| 10 |
+
- PaddlePaddle
|
| 11 |
+
- PaddleOCR
|
| 12 |
+
- text_recognition
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
<div align="center">
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
<h1 align="center">
|
| 19 |
+
|
| 20 |
+
PP-OCRv6: From 1.5M to 34.5M Parameters, Surpassing Billion-Scale VLMs on OCR Tasks
|
| 21 |
+
|
| 22 |
+
</h1>
|
| 23 |
+
|
| 24 |
+
[](https://github.com/PaddlePaddle/PaddleOCR)
|
| 25 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_rec_safetensors)
|
| 26 |
+
[](https://x.com/PaddlePaddle)
|
| 27 |
+
[](./LICENSE)
|
| 28 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_rec)
|
| 29 |
+
[](https://huggingface.co/PaddlePaddle/PP-OCRv6_medium_rec_onnx)
|
| 30 |
+
|
| 31 |
+
**🔥 [Official Website](https://www.paddleocr.com)**
|
| 32 |
+
**📝 [Technical Report](https://arxiv.org/pdf/2606.13108)**
|
| 33 |
+
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<div align="center">
|
| 37 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/684ba591e717a30275a1b76a/0XIrg0UmmOvplnPjmsmK3.png" width="800"/>
|
| 38 |
+
</div>
|
| 39 |
+
|
| 40 |
+
## PP-OCRv6 Overview
|
| 41 |
+
|
| 42 |
+
PP-OCRv6 is a lightweight OCR system that combines architectural innovation with data-centric optimization. It redesigns the backbone, detection neck, and recognition neck around a unified MetaFormer-style building block with structural reparameterization. Three model tiers (medium, small, tiny) share the same block primitives, covering deployment scenarios from server to edge.
|
| 43 |
+
|
| 44 |
+
### Key Features
|
| 45 |
+
|
| 46 |
+
1. **Unified and Scalable Model Family:** A three-tier OCR model family spanning 1.5M to 34.5M parameters. PP-OCRv6_medium achieves 86.2% detection Hmean and 83.2% recognition accuracy, outperforming PP-OCRv5_server by +4.6% and +5.1% respectively.
|
| 47 |
+
|
| 48 |
+
2. **Lightweight Architectural Innovations:** (i) LCNetV4, a MetaFormer-style lightweight backbone with structural reparameterization; (ii) RepLKFPN, a detection neck with dilated reparameterizable depthwise convolutions; (iii) EncoderWithLightSVTR, a recognition neck with local-global attention and additive skip connections.
|
| 49 |
+
|
| 50 |
+
3. **Multi-Language and Scenario Support:** Supports 50 languages and diverse industrial scenes (digital displays, dot-matrix characters, tire prints, etc.), surpassing Qwen3-VL-235B, GPT-5.5, and Gemini-3.1-Pro with orders of magnitude fewer parameters.
|
| 51 |
+
|
| 52 |
+
# PP-OCRv6_medium_rec
|
| 53 |
+
|
| 54 |
+
## Introduction
|
| 55 |
+
|
| 56 |
+
<div align="center">
|
| 57 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/684ba591e717a30275a1b76a/9hBYIA-pO6jhnG6bcZEaf.png" width="600"/>
|
| 58 |
+
|
| 59 |
+
PP-OCRv6 text recognition architecture overview
|
| 60 |
+
</div>
|
| 61 |
+
|
| 62 |
+
PP-OCRv6_medium_rec is the largest recognition model in the PP-OCRv6 series. It uses LCNetV4 as the backbone and EncoderWithLightSVTR as the recognition neck, with a CTC+NRTR multi-head decoder. The model supports 50 languages and contains 19M parameters. The key accuracy metrics are as follows:
|
| 63 |
+
|
| 64 |
+
| Model | W-Avg | Handwritten CN | Handwritten EN | Printed CN | Printed EN | TC | Ancient | JP | Confusable | Special | General | Pinyin | Artistic | Industrial | Screen | Card |
|
| 65 |
+
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
| 66 |
+
| GPT-5.5 | 64.2 | 19.2 | 56.9 | 75.7 | 82.2 | 57.5 | 63.7 | 58.6 | 49.1 | 48.3 | 67.7 | 50.4 | 53.0 | 62.4 | 67.7 | 71.1 |
|
| 67 |
+
| Qwen3-VL-235B | 74.9 | 49.7 | 73.2 | 82.3 | 86.2 | 76.4 | 33.6 | 66.2 | 56.1 | 49.0 | 82.5 | 76.5 | 69.6 | 74.7 | 73.8 | 78.7 |
|
| 68 |
+
| Kimi-K2.6 | 62.9 | 31.0 | 58.4 | 76.8 | 80.9 | 62.7 | 16.5 | 54.1 | 43.5 | 38.0 | 68.0 | 45.2 | 59.9 | 57.1 | 58.4 | 68.4 |
|
| 69 |
+
| MiniMax-M3 | 54.1 | 15.5 | 60.3 | 63.5 | 81.5 | 53.2 | 2.2 | 43.7 | 42.2 | 42.8 | 53.8 | 50.3 | 44.3 | 44.1 | 56.6 | 67.0 |
|
| 70 |
+
| Gemini-3.1-Pro | 71.4 | 46.4 | 73.0 | 80.0 | 90.5 | 69.5 | 18.0 | 67.2 | 54.4 | 50.3 | 74.6 | 75.9 | 63.1 | 69.1 | 73.2 | 75.9 |
|
| 71 |
+
| PP-OCRv5_server | 78.1 | 58.0 | 59.6 | 90.1 | 85.1 | 74.7 | 60.4 | 73.7 | 59.4 | 56.8 | 86.5 | 74.4 | 64.0 | 70.2 | 68.1 | 87.6 |
|
| 72 |
+
| PP-OCRv5_mobile | 73.7 | 41.7 | 50.9 | 86.0 | 86.0 | 72.0 | 57.8 | 75.8 | 55.7 | 54.8 | 80.7 | 72.5 | 54.0 | 59.3 | 57.6 | 81.7 |
|
| 73 |
+
| **PP-OCRv6_medium** | **83.2** | **62.1** | **67.8** | **91.5** | **94.1** | **78.6** | **72.4** | **90.5** | **64.9** | **61.7** | **87.5** | **78.1** | **71.2** | **77.4** | **82.5** | **88.1** |
|
| 74 |
+
| PP-OCRv6_small | 81.3 | 57.6 | 61.1 | 90.5 | 93.3 | 77.0 | 71.1 | 88.2 | 64.1 | 60.2 | 85.7 | 75.9 | 68.4 | 76.4 | 79.7 | 86.9 |
|
| 75 |
+
| PP-OCRv6_tiny | 73.5 | 40.1 | 39.3 | 86.7 | 88.4 | 65.0 | 68.4 | 89.8 | 52.3 | 57.1 | 78.0 | 65.4 | 54.7 | 62.1 | 71.2 | 80.5 |
|
| 76 |
+
|
| 77 |
+
## Quick Start
|
| 78 |
+
|
| 79 |
+
### Installation
|
| 80 |
+
|
| 81 |
+
1. PaddleOCR
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
# Install the basic version
|
| 85 |
+
pip install paddleocr
|
| 86 |
+
|
| 87 |
+
# Install the full version (includes all features)
|
| 88 |
+
pip install "paddleocr[all]"
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
2. Transformers environment (required for safetensors models)
|
| 92 |
+
|
| 93 |
+
```bash
|
| 94 |
+
pip install transformers torch
|
| 95 |
+
```
|
| 96 |
+
|
| 97 |
+
### Model Usage
|
| 98 |
+
|
| 99 |
+
You can quickly experience the functionality with a single command:
|
| 100 |
+
|
| 101 |
+
```bash
|
| 102 |
+
paddleocr text_recognition \
|
| 103 |
+
--model_name PP-OCRv6_medium_rec \
|
| 104 |
+
--engine transformers \
|
| 105 |
+
-i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/2PZfbirjfxA88695lRmgk.jpeg
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
You can also integrate the model inference of the text recognition module into your project. Before running the following code, please download the sample image to your local machine.
|
| 109 |
+
|
| 110 |
+
```python
|
| 111 |
+
from paddleocr import TextRecognition
|
| 112 |
+
model = TextRecognition(model_name="PP-OCRv6_medium_rec", engine="transformers")
|
| 113 |
+
output = model.predict(input="2PZfbirjfxA88695lRmgk.jpeg", batch_size=1)
|
| 114 |
+
for res in output:
|
| 115 |
+
res.print()
|
| 116 |
+
res.save_to_json(save_path="./output/res.json")
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
After running, the obtained result is as follows:
|
| 120 |
+
|
| 121 |
+
```json
|
| 122 |
+
{'res': {'input_path': '2PZfbirjfxA88695lRmgk.jpeg', 'page_index': None, 'rec_text': 'day as a reminder of the', 'rec_score': 0.9857}}
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
The visualized image is as follows:
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
|
| 129 |
+
<!-- TODO: Update document links to PP-OCRv6 official documentation when available -->
|
| 130 |
+
For details about usage command and descriptions of parameters, please refer to the [Document](https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/text_recognition.html).
|
| 131 |
+
|
| 132 |
+
### Pipeline Usage
|
| 133 |
+
|
| 134 |
+
The general OCR pipeline is used to solve text recognition tasks by extracting text information from images. The pipeline consists of several modules:
|
| 135 |
+
* Document Image Orientation Classification Module (Optional)
|
| 136 |
+
* Text Image Unwarping Module (Optional)
|
| 137 |
+
* Text Line Orientation Classification Module (Optional)
|
| 138 |
+
* Text Detection Module
|
| 139 |
+
* Text Recognition Module
|
| 140 |
+
|
| 141 |
+
Run a single command to quickly experience the OCR pipeline:
|
| 142 |
+
|
| 143 |
+
```bash
|
| 144 |
+
paddleocr ocr -i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/3ul2Rq4Sk5Cn-l69D695U.png \
|
| 145 |
+
--text_detection_model_name PP-OCRv6_medium_det \
|
| 146 |
+
--text_recognition_model_name PP-OCRv6_medium_rec \
|
| 147 |
+
--engine transformers \
|
| 148 |
+
--use_doc_orientation_classify False \
|
| 149 |
+
--use_doc_unwarping False \
|
| 150 |
+
--use_textline_orientation True \
|
| 151 |
+
--save_path ./output \
|
| 152 |
+
--device gpu:0
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
If save_path is specified, the visualization results will be saved under `save_path`. The visualization output is shown below:
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
|
| 159 |
+
For project integration:
|
| 160 |
+
|
| 161 |
+
```python
|
| 162 |
+
from paddleocr import PaddleOCR
|
| 163 |
+
|
| 164 |
+
ocr = PaddleOCR(
|
| 165 |
+
text_detection_model_name="PP-OCRv6_medium_det",
|
| 166 |
+
text_recognition_model_name="PP-OCRv6_medium_rec",
|
| 167 |
+
engine="transformers",
|
| 168 |
+
use_doc_orientation_classify=False,
|
| 169 |
+
use_doc_unwarping=False,
|
| 170 |
+
use_textline_orientation=True,
|
| 171 |
+
)
|
| 172 |
+
result = ocr.predict("./3ul2Rq4Sk5Cn-l69D695U.png")
|
| 173 |
+
for res in result:
|
| 174 |
+
res.print()
|
| 175 |
+
res.save_to_img("output")
|
| 176 |
+
res.save_to_json("output")
|
| 177 |
+
```
|
| 178 |
+
|
| 179 |
+
<!-- TODO: Update document links to PP-OCRv6 official documentation when available -->
|
| 180 |
+
For details about usage command and descriptions of parameters, please refer to the [Document](https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/pipeline_usage/OCR.html#2-quick-start).
|
| 181 |
+
|
| 182 |
+
## Links
|
| 183 |
+
|
| 184 |
+
[PaddleOCR Repo](https://github.com/paddlepaddle/paddleocr)
|
| 185 |
+
|
| 186 |
+
[PaddleOCR Documentation](https://paddlepaddle.github.io/PaddleOCR/latest/en/index.html)
|
| 187 |
+
|
| 188 |
+
## Citation
|
| 189 |
+
|
| 190 |
+
```bibtex
|
| 191 |
+
@misc{zhang2026ppocrv6,
|
| 192 |
+
title={PP-OCRv6: From 1.5M to 34.5M Parameters, Surpassing Billion-Scale VLMs on OCR Tasks},
|
| 193 |
+
author={Yubo Zhang and Xueqing Wang and Manhui Lin and Yue Zhang and Penglongyi Deng and Ting Sun and Tingquan Gao and Zelun Zhang and Jiaxuan Liu and Changda Zhou and Hongen Liu and Suyin Liang and Cheng Cui and Yi Liu and Dianhai Yu and Yanjun Ma},
|
| 194 |
+
year={2026},
|
| 195 |
+
eprint={2606.13108},
|
| 196 |
+
archivePrefix={arXiv},
|
| 197 |
+
primaryClass={cs.CV},
|
| 198 |
+
url={https://arxiv.org/abs/2606.13108},
|
| 199 |
+
}
|
| 200 |
+
```
|
PPv6/PP-OCRv6_medium_rec_safetensors/config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "pp_ocrv6_small_rec",
|
| 3 |
+
"backbone_config": {
|
| 4 |
+
"model_type": "pp_lcnet_v4",
|
| 5 |
+
"stem_channels": [3, 64, 128],
|
| 6 |
+
"stem_type": "large",
|
| 7 |
+
"out_features": ["stage1", "stage2", "stage3", "stage4"],
|
| 8 |
+
"out_indices": [1, 2, 3, 4],
|
| 9 |
+
"block_configs": [
|
| 10 |
+
[[3, 128, 128, 1, true]],
|
| 11 |
+
[
|
| 12 |
+
[3, 128, 256, 1, false],
|
| 13 |
+
[3, 256, 256, 1, false],
|
| 14 |
+
[3, 256, 256, 1, true]
|
| 15 |
+
],
|
| 16 |
+
[
|
| 17 |
+
[3, 256, 512, [2, 1], false],
|
| 18 |
+
[3, 512, 512, 1, true],
|
| 19 |
+
[3, 512, 512, 1, false],
|
| 20 |
+
[3, 512, 512, 1, true],
|
| 21 |
+
[3, 512, 512, 1, false],
|
| 22 |
+
[3, 512, 512, 1, true],
|
| 23 |
+
[3, 512, 512, 1, false]
|
| 24 |
+
],
|
| 25 |
+
[
|
| 26 |
+
[3, 512, 768, [2, 1], false],
|
| 27 |
+
[3, 768, 768, 1, true],
|
| 28 |
+
[3, 768, 768, 1, false]
|
| 29 |
+
]
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
"hidden_act": "silu",
|
| 33 |
+
"hidden_size": 192,
|
| 34 |
+
"mlp_ratio": 4.0,
|
| 35 |
+
"depth": 2,
|
| 36 |
+
"head_out_channels": 18710,
|
| 37 |
+
"conv_kernel_size": [1, 7]
|
| 38 |
+
}
|
PPv6/PP-OCRv6_medium_rec_safetensors/inference.yml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
PPv6/PP-OCRv6_medium_rec_safetensors/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f43c16f2a684b1d2284662178bdb604febd3d6bfdb5ca73828d08d0f7c0c3e9
|
| 3 |
+
size 76741720
|
PPv6/PP-OCRv6_medium_rec_safetensors/preprocessor_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
main_v6.py
CHANGED
|
@@ -44,6 +44,7 @@ if __name__ == '__main__':
|
|
| 44 |
text_recognition_model_dir="./PPv6/PP-OCRv6_medium_rec_safetensors",
|
| 45 |
lang='chinese_cht', # 繁体字典
|
| 46 |
return_word_box=True, # 返回每个字符的坐标
|
|
|
|
| 47 |
use_doc_orientation_classify=True, # 整页方向(横/倒)
|
| 48 |
# use_doc_unwarping=True, # 弯曲矫正,扫描古籍有用
|
| 49 |
use_textline_orientation=True, # 文本行方向分类,竖排靠它
|
|
|
|
| 44 |
text_recognition_model_dir="./PPv6/PP-OCRv6_medium_rec_safetensors",
|
| 45 |
lang='chinese_cht', # 繁体字典
|
| 46 |
return_word_box=True, # 返回每个字符的坐标
|
| 47 |
+
return_char=True, # 返回字符级四角坐标
|
| 48 |
use_doc_orientation_classify=True, # 整页方向(横/倒)
|
| 49 |
# use_doc_unwarping=True, # 弯曲矫正,扫描古籍有用
|
| 50 |
use_textline_orientation=True, # 文本行方向分类,竖排靠它
|