PP OCRv4 Server Det
PP-OCRv4_server_det 是 PaddleOCR 团队开发的文本检测模型,适用于高性能服务器部署,具有高准确率。
下载量 297
发布时间 : 6/6/2025
模型简介
PP-OCRv4_server_det 是 PP-OCRv4_det 系列模型之一,专为服务器端设计,支持多种语言和复杂场景的文本检测。
模型特点
高准确率
在多种语言和复杂场景下表现优异,平均准确率达到 0.662。
多语言支持
支持手写中文、印刷中文、英文、繁体中文、日文等多种语言的文本检测。
复杂场景适应
能够处理旋转、扭曲、艺术字等复杂场景的文本检测。
模型能力
文本检测
多语言文本识别
复杂场景文本处理
使用案例
文档处理
印刷文档文本检测
检测印刷文档中的文本区域,支持中文和英文。
准确率高达 0.888(印刷中文)和 0.690(印刷英文)。
手写文本识别
手写中文文本检测
检测手写中文文本区域。
准确率为 0.706。
🚀 PP-OCRv4_server_det
PP-OCRv4_server_det 是 PP-OCRv4_det 系列模型之一,是由 PaddleOCR 团队开发的一组文本检测模型。这个服务端文本检测模型具有更高的准确率,适合部署在高性能服务器上。
✨ 主要特性
PP-OCRv4_server_det 模型的关键准确率指标如下:
手写中文 | 手写英文 | 印刷中文 | 印刷英文 | 繁体中文 | 古文 | 日文 | 通用场景 | 拼音 | 旋转 | 扭曲 | 艺术字 | 平均 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0.706 | 0.249 | 0.888 | 0.690 | 0.759 | 0.473 | 0.685 | 0.715 | 0.542 | 0.366 | 0.775 | 0.583 | 0.662 |
📦 安装指南
1. 安装 PaddlePaddle
请参考以下命令,使用 pip 安装 PaddlePaddle:
# 适用于 CUDA11.8
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
# 适用于 CUDA12.6
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
# 适用于 CPU
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
PaddlePaddle 安装详情请参考 PaddlePaddle 官方网站。
2. 安装 PaddleOCR
从 PyPI 安装最新版本的 PaddleOCR 推理包:
python -m pip install paddleocr
💻 使用示例
基础用法
你可以使用单个命令快速体验其功能:
paddleocr text_detection \
--model_name PP-OCRv4_server_det \
-i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/3ul2Rq4Sk5Cn-l69D695U.png
你也可以将文本检测模块的模型推理集成到你的项目中。在运行以下代码之前,请将示例图像下载到本地。
from paddleocr import TextDetection
model = TextDetection(model_name="PP-OCRv4_server_det")
output = model.predict(input="3ul2Rq4Sk5Cn-l69D695U.png", 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")
运行后,得到的结果如下:
{'res': {'input_path': '/root/.paddlex/predict_input/3ul2Rq4Sk5Cn-l69D695U.png', 'page_index': None, 'dt_polys': array([[[ 627, 1432],
...,
[ 627, 1449]],
...,
[[ 354, 106],
...,
[ 354, 127]]], dtype=int16), 'dt_scores': [0.9421815230284514, 0.8528662776681952, ..., 0.8209321007152185]}}
可视化图像如下:
使用命令和参数说明的详细信息,请参考 文档。
高级用法
单个模型的能力是有限的,但由多个模型组成的管道可以提供更强的能力来解决现实场景中的难题。
PP-OCRv4
通用 OCR 管道用于通过从图像中提取文本信息并以文本形式输出,来解决文本识别任务。管道中有 5 个模块:
- 文档图像方向分类模块(可选)
- 文本图像矫正模块(可选)
- 文本行方向分类模块(可选)
- 文本检测模块
- 文本识别模块
运行单个命令快速体验 OCR 管道:
paddleocr ocr -i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/3ul2Rq4Sk5Cn-l69D695U.png \
--text_detection_model_name PP-OCRv4_server_det \
--text_recognition_model_name PP-OCRv4_server_rec \
--use_doc_orientation_classify False \
--use_doc_unwarping False \
--use_textline_orientation False \
--save_path ./output \
--device gpu:0
结果会打印到终端:
{'res': {'input_path': '/root/.paddlex/predict_input/3ul2Rq4Sk5Cn-l69D695U.png', 'page_index': None, 'model_settings': {'use_doc_preprocessor': True, 'use_textline_orientation': False}, 'doc_preprocessor_res': {'input_path': None, 'page_index': None, 'model_settings': {'use_doc_orientation_classify': False, 'use_doc_unwarping': False}, 'angle': -1}, 'dt_polys': array([[[ 355, 109],
...,
[ 355, 126]],
...,
[[ 631, 1431],
...,
[ 631, 1450]]], dtype=int16), 'text_det_params': {'limit_side_len': 64, 'limit_type': 'min', 'thresh': 0.3, 'max_side_limit': 4000, 'box_thresh': 0.6, 'unclip_ratio': 1.5}, 'text_type': 'general', 'textline_orientation_angles': array([-1, ..., -1]), 'text_rec_score_thresh': 0.0, 'rec_texts': ['AlgorithmsfortheMarkovEntropyDecomposition', 'AndrewJ.FerrisandDavidPoulin', 'DepartementdePhysique,UniversitedeSherbrooke,Quebec,JlK2Rl,Canada', '(Dated:October31,2018)', 'TheMarkoventropydecomposition', '(MED)is a recently-proposed, cluster-based simulation method for fi-', 'nite temperature quantum systems with arbitrary geometry. In this p', 'paper,wedetail numerical algorithms for', 'performing the required steps of the MED,principally solving a minimization problem with a', 'preconditioned', 'astea1ocrtratnrtpccc', "Newton's", 'algorithm,as well as how to extract global susceptibilities and thermal responses.', 'Wedemonstrate', 'the power of the method with the spin-l/2 XXZ model on the 2D squarelattice, including the extraction of', 'critical points and details of each phase. Although the method shares some qualitative similarities with exact-', 'diagonalization,we show the MED is both more accurate and significantly more flexible.', 'PACSnumbers:05.10.-a, 02.50.Ng,03.67.-a,74.40.Kb', 'I.INTRODUCTION', 'This approximation becomes exact in the case of a 1D', 'quan-', 'tum(orclassical)', 'Markov chain', '[10],and leads to an', 'expo-', 'Although', 'the', 'equations', 'governing', 'quantum many-body', 'nentialreduction', '1 of cost for exact entropy calculations when', 'systems are', 'simplet', 'writedown,findin', 'solutions', 'sforthe', 'the global density matrix is a higher-dimensional Markov net-', 'majority', 'of', 'systems', 'remains incredibly', 'difficult.', 'Modern', 'workstate', '[12,13].', 'physics finds itself in need of new', 'tools to compute the emer-', 'gentbehavior of large, many-body', 'ysystems.', 'related to the V-representibility problem. Given a set of lo-', 'Therehasbeen', 'greatvariety', 'r oftools developed to tackle', 'calbutoverlapping', 'reduced density', 'matrices{pi},it is avery', 'many-bodyproblems', 's,butin', 'general,large', '2D', 'and3D', 'quan-', 'challenging', 'problemto determinei', 'ifthereexists', 'globalden-', 'tum', 'systems', 'remain', 'hard', 'deal', 'with.', 'Most', 'systems', 'are', 'sity operator which is positive semi-definite and whose partial', 'thought to be non-integrable, so exact analytic solutions are', 'trace agrees', 'with', 'each', 'p.This', 'problemisQMA-hard', '(the', 'notusually expected.Direct numerical diagonalization canbe', 'quantum analogue of NP)', '[14,', '151.', 'and is hopelessly', 'diffi-', 'performedforrelatively', 'small', 'wstems', '-howevertheemer-', 'cultto', 'enforce.', 'Thus', 'the', 'second', 'pproximationemployed', 'gentbehaviorofas', 'ystem in thethermodynamiclimitmaybe', 'involves ignoringglobal consistency', 'with a', 'positive', 'opera-', 'difficult to extract, especially in s', 'ystemswithlarge', 'correlation', 'tor,while', 'requiring', 'localconsistenc', 'on any overlapping re-', 'lengths.MonteCarlo', 'approaches are technically', '/exact(upto', 'gionsbetween thep.Atthezero-temperaturelimit,theMED', 'sampling', 'error),but', 'suffer', 'fromthe', 'so-called', 'ign', 'problem', 'approach becomes analogous to the', 'ariationalnth-orderre-', '111', 'for fermionic, frustrated, or dynamical problems. Thus', 'weare', 'duceddensity', 'matrix', 'approach,', 'where', 'positivity is enforced', 'limitedto', 'search for clever', ' approximations to solve the ma-', 'on all reduced density', 'matrices of size', '[16-18].', ' jority of many-body problems.', 'The MED approach is an extremely flexible cluster method,', 'Overthe', 'pastcentury', 'hundredsof such', 'approximations', 'applicable to both translationally', 'y invariant systems of any di-', 'havebeen', 'proposed,', ' and we will mention just a few notable', 'mension in the thermodynamic limit.', 'as well asfinite', 'ystems', 'examples', 'applicable', 'quantum lattice', 'odels.Mean-field', 'or systems', 'without translational invariance (e.g.', 'disordered', 'theory', 'is simple and frequently', 'arrives', 'at the correct', 'quali-', 'lattices,', 'or harmonically', 'trappedatomsin', 'optical lattices).', 'tative description,but', 'often fails', 'swhen', 'correlations', 'are im-', 'Thefreeenergygivenby', 'MEDis', 'guaranteed to lower', 'bound', 'portant. Density-matrix renormalisation', 'group (DMRG)[1]', 'the true free', 'energy', 'which in turn lower-bounds the', 'ground', 'is efficient and extremely', 'accurate at solving', '1D', 'problems,', 'stateenergy', '—thus', 'providing a natural complement to varia-', 'butthe computational cost', 'grows exponentially', 'ywithsystem', 'tionalapproacheswhich upper-boundthe', 'ground state energy.', 'size in two- or higher-dimensions', '[2,3].', 'Related tensor-', 'The ability to provide a rigorous', 's ground-stateenergywindow', 'networktechniquesdesigned for2D', 'ystemsarestill intheir', 'is apowerful validation tool, creating', 'averycompellingrea-', 'infancy [4-6]. Series-expansion methods', '7', 'canbe success-', 'son to use this approach.', 'ful, but may diverge', 'orotherwise converge', 'eslowly,obscuring', 'In this paper we paper we present a pedagogical introduc-', 'thestatein', '1certain', 'regimes. There exist', 'variety', 'of cluster-', 'tion toMED, includingnumericalimplementation issues and', 'based techniques', 'such as', 'dynamical-mean-field theory[8]', 'applications', 'to 2D quantum lattice', 'models in the thermody-', 'anddensity', '7-matrix', 'embedding[9].', 'namiclimit.', 'In Sec.II,we', 'give a brief derivation', 'ofthe', 'Herewe', 'discuss the so-called Markov entropy decompo-', 'Markov entropy decomposition.', 'SectionIlloutlinesarobust', 'sition (MED),recently', 'proposedby', 'Poulin&Hastings', '[10]', 'numerical strategy for', 'optimizing', 'the clusters that make up', '(andanalogous to a slightly', 'earlier', ' classical algorithm', '[11])', 'thedecomposition.', 'InSec.IVw', 'show how we can extend', 'This is', 'a self-consistent', 'cluster method for finite temperature', 'thesealgorithmsto', 'extract non-trivial', 'information,suchas', 'systems that takes advantage of an ', 'approximationofthe(von', 'specific heat and susceptibilities.We present an application of', 'Neumann)entropy.', 'In[10],itwas', 'shown that the entropy', 'the method to the spin-1/2 XXZ model on a 2D squarelattice', 'per site can be rigorously upper bounded using only local in-', 'in Sec.V,describing how to characterize the phase diagram', 'formation—alocal.reduceddensity', 'matrix onN sites,say.', 'and determine critical points, before concluding in Sec.VI.'], 'rec_scores': array([0.98928159, ..., 0.98077077]), 'rec_polys': array([[[ 355, 109],
...,
[ 355, 126]],
...,
[[ 631, 1431],
...,
[ 631, 1450]]], dtype=int16), 'rec_boxes': array([[ 355, ..., 126],
...,
[ 631, ..., 1450]], dtype=int16)}}
如果指定了 save_path
,可视化结果将保存到 save_path
下。可视化输出如下:
命令行方法用于快速体验。对于项目集成,也只需要几行代码:
from paddleocr import PaddleOCR
ocr = PaddleOCR(
text_detection_model_name="PP-OCRv4_server_det",
text_recognition_model_name="PP-OCRv4_server_rec",
use_doc_orientation_classify=False, # 通过此参数禁用文档方向分类模型
use_doc_unwarping=False, # 通过此参数禁用文本图像矫正模型
use_textline_orientation=False, # 通过此参数禁用文本行方向分类模型
)
result = ocr.predict("./general_ocr.png")
for res in result:
res.print()
res.save_to_img("output")
res.save_to_json("output")
使用命令和参数说明的详细信息,请参考 文档。
📚 详细文档
📄 许可证
本项目采用 Apache-2.0 许可证。
Table Transformer Structure Recognition
MIT
基于PubTables1M数据集训练的表格变换器模型,用于从非结构化文档中提取表格结构
文字识别
Transformers

T
microsoft
1.2M
186
Trocr Small Handwritten
TrOCR是一个基于Transformer的光学字符识别模型,专门用于手写文本图像的识别。
文字识别
Transformers

T
microsoft
517.96k
45
Table Transformer Structure Recognition V1.1 All
MIT
基于Transformer的表格结构识别模型,用于检测文档中的表格结构
文字识别
Transformers

T
microsoft
395.03k
70
Trocr Large Printed
基于Transformer的光学字符识别模型,适用于单行印刷体文本识别
文字识别
Transformers

T
microsoft
295.59k
162
Texify
Texify 是一个 OCR 工具,专门用于将公式图片和文本转换为 LaTeX 格式。
文字识别
Transformers

T
vikp
206.53k
15
Trocr Base Printed
TrOCR是基于Transformer的光学字符识别模型,专为单行文本图像识别设计,采用编码器-解码器架构
文字识别
Transformers

T
microsoft
184.84k
169
Manga Ocr Base
Apache-2.0
专为日语文本设计的光学字符识别工具,主要针对日本漫画场景优化。
文字识别
Transformers 日语

M
kha-white
130.36k
145
Trocr Large Handwritten
TrOCR是基于Transformer的光学字符识别模型,专为手写文本识别设计,在IAM数据集上进行了微调。
文字识别
Transformers

T
microsoft
59.17k
115
Trocr Small Printed
TrOCR是一个基于Transformer的光学字符识别模型,适用于单行文本图像的OCR任务。
文字识别
Transformers

T
microsoft
20.88k
40
Lilt Roberta En Base
MIT
语言无关版式变换器(LiLT)通过将预训练的RoBERTa(英文)与预训练的语言无关版式变换器(LiLT)拼接,为任何语言提供类似LayoutLM的模型。
文字识别
Transformers

L
SCUT-DLVCLab
12.05k
19
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98