Views
No views yet
| Model | mAP(0.5) (%) |
|---|---|
| PicoDet-S_layout_17cls | 87.4 |
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 layout_detection \
2 --model_name PicoDet-S_layout_17cls \
3 -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/N5C68HPVAI-xQAWTxpbA6.jpeg1from paddleocr import LayoutDetection
2
3model = LayoutDetection(model_name="PicoDet-S_layout_17cls")
4output = model.predict("N5C68HPVAI-xQAWTxpbA6.jpeg", batch_size=1, layout_nms=True)
5for res in output:
6 res.print()
7 res.save_to_img(save_path="./output/")
8 res.save_to_json(save_path="./output/res.json"){'res': {'input_path': '/root/.paddlex/predict_input/N5C68HPVAI-xQAWTxpbA6.jpeg', 'page_index': None, 'boxes': [{'cls_id': 2, 'label': 'text', 'score': 0.9770552515983582, 'coordinate': [35.47857, 350.32135, 359.99146, 607.66266]}, {'cls_id': 2, 'label': 'text', 'score': 0.9646613597869873, 'coordinate': [387.4421, 736.655, 712.7056, 850.04584]}, {'cls_id': 2, 'label': 'text', 'score': 0.9596860408782959, 'coordinate': [386.36847, 491.56995, 712.53467, 700.74225]}, {'cls_id': 2, 'label': 'text', 'score': 0.958072304725647, 'coordinate': [36.283585, 648.58374, 360.08328, 849.8185]}, {'cls_id': 8, 'label': 'table', 'score': 0.9491577744483948, 'coordinate': [62.92192, 104.4335, 330.56216, 299.23947]}, {'cls_id': 8, 'label': 'table', 'score': 0.9144826531410217, 'coordinate': [424.8911, 104.26025, 668.0119, 312.7304]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.8392149806022644, 'coordinate': [35.642235, 332.62488, 144.75916, 345.07657]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.796416699886322, 'coordinate': [389.69257, 717.66345, 526.9109, 729.3157]}, {'cls_id': 2, 'label': 'text', 'score': 0.6687009930610657, 'coordinate': [391.08237, 348.05475, 713.2955, 460.1097]}, {'cls_id': 2, 'label': 'text', 'score': 0.6419706344604492, 'coordinate': [35.950676, 21.344364, 361.3897, 79.71692]}, {'cls_id': 2, 'label': 'text', 'score': 0.5499911308288574, 'coordinate': [386.94125, 19.868908, 713.5697, 75.554535]}]}}
1paddleocr table_recognition_v2 -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/tuY1zoUdZsL6-9yGG0MpU.jpeg \
2 --layout_detection_model_name PicoDet-S_layout_17cls \
3 --use_doc_orientation_classify False \
4 --use_doc_unwarping False \
5 --save_path ./output \
6 --device gpu:0
7save_path.1from paddleocr import TableRecognitionPipelineV2
2
3pipeline = TableRecognitionPipelineV2(
4 layout_detection_model_name=PicoDet-S_layout_17cls,
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 )
9
10output = pipeline.predict("tuY1zoUdZsL6-9yGG0MpU.jpeg")
11for res in output:
12 res.print() ## Print the predicted structured output
13 res.save_to_img("./output/")
14 res.save_to_xlsx("./output/")
15 res.save_to_html("./output/")
16 res.save_to_json("./output/")PP-DocLayout-L, so it is needed that specifing to PicoDet-S_layout_17cls by argument layout_detection_model_name. And you can also use the local model file by argument layout_detection_model_dir. For details about usage command and descriptions of parameters, please refer to the Document.