Views
No views yet
| Model | Hmean (%) |
|---|---|
| PP-OCRv4_server_seal_det | 98.21 |
1# for CUDA11.8
2python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
3
4# for CUDA12.6
5python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
6
7# for CPU
8python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/python -m pip install paddleocr1paddleocr seal_text_detection \
2 --model_name PP-OCRv4_server_seal_det \
3 -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/k02u35x60XZmaL9hzeQ0T.png1from paddleocr import SealTextDetection
2model = SealTextDetection(model_name="PP-OCRv4_server_seal_det")
3output = model.predict(input="k02u35x60XZmaL9hzeQ0T.png", batch_size=1)
4for res in output:
5 res.print()
6 res.save_to_img(save_path="./output/")
7 res.save_to_json(save_path="./output/res.json")1{'res': {'input_path': 'k02u35x60XZmaL9hzeQ0T.png', 'page_index': None, 'dt_polys': [array([[165, 469],
2 ...,
3 [161, 466]]), array([[444, 444],
4 ...,
5 [441, 443]]), array([[466, 346],
6 ...,
7 [462, 345]]), array([[324, 38],
8 ...,
9 [320, 37]])], 'dt_scores': [0.989991263358307, 0.9934761181445114, 0.9916670610495292, 0.9857514344934838]}}
1paddleocr seal_recognition -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/k02u35x60XZmaL9hzeQ0T.png \
2 --seal_text_detection_model_name PP-OCRv4_server_seal_det \
3 --use_doc_orientation_classify False \
4 --use_doc_unwarping False \
5 --save_path ./output \
6 --device gpu:0 1{'res': {'input_path': '/root/.paddlex/predict_input/k02u35x60XZmaL9hzeQ0T.png', 'model_settings': {'use_doc_preprocessor': True, 'use_layout_detection': True}, 'doc_preprocessor_res': {'input_path': None, 'page_index': None, 'model_settings': {'use_doc_orientation_classify': False, 'use_doc_unwarping': False}, 'angle': -1}, 'layout_det_res': {'input_path': None, 'page_index': None, 'boxes': [{'cls_id': 16, 'label': 'seal', 'score': 0.9755404591560364, 'coordinate': [6.19458, 0.17910767, 634.38385, 628.8424]}]}, 'seal_res_list': [{'input_path': None, 'page_index': None, 'model_settings': {'use_doc_preprocessor': False, 'use_textline_orientation': False}, 'dt_polys': [array([[320, 38],
2 ...,
3 [315, 38]]), array([[461, 347],
4 ...,
5 [456, 346]]), array([[439, 445],
6 ...,
7 [434, 444]]), array([[158, 468],
8 ...,
9 [154, 466]])], 'text_det_params': {'limit_side_len': 736, 'limit_type': 'min', 'thresh': 0.2, 'max_side_limit': 4000, 'box_thresh': 0.6, 'unclip_ratio': 0.5}, 'text_type': 'seal', 'textline_orientation_angles': array([-1, ..., -1]), 'text_rec_score_thresh': 0, 'rec_texts': ['天津君和缘商贸有限公司', '发票专用章', '吗繁物', '5263647368706'], 'rec_scores': array([0.99340463, ..., 0.9916274 ]), 'rec_polys': [array([[320, 38],
10 ...,
11 [315, 38]]), array([[461, 347],
12 ...,
13 [456, 346]]), array([[439, 445],
14 ...,
15 [434, 444]]), array([[158, 468],
16 ...,
17 [154, 466]])], 'rec_boxes': array([], dtype=float64)}]}}save_path. The visualization output is shown below:
1from paddleocr import PaddleOCR
2
3ocr = PaddleOCR(
4 seal_text_detection_model_name="PP-OCRv4_server_seal_det",
5 use_doc_orientation_classify=False, # Use use_doc_orientation_classify to enable/disable document orientation classification model
6 use_doc_unwarping=False, # Use use_doc_unwarping to enable/disable document unwarping module
7 device="gpu:0", # Use device to specify GPU for model inference
8)
9result = ocr.predict("https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/k02u35x60XZmaL9hzeQ0T.png")
10for res in result:
11 res.print()
12 res.save_to_img("output")
13 res.save_to_json("output")PP-OCRv4_server_seal_det. For details about usage command and descriptions of parameters, please refer to the Document.