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