Zum Inhalt springen
ModelAufgelistetExtern
Herunterladen

PP DocBlockLayout Safetensors

A layout block localization model trained on a self-built dataset containing Chinese and English papers, PPT, multi-layout magazines, contracts, books, exams, ancient books and research reports using RT-DETR-L. The...

ArtOtherVersionRevision 1fc8f5eBBewertung

Modellquelle

Art
Other
Dateigröße
126 MB
Version
vRevision 1fc8f5e
Aktualisiert
16. Okt. 2026
Downloads
49
Quelle
Hugging Face

Quellenbeschreibung

PP-DocBlockLayout

Introduction

A layout block localization model trained on a self-built dataset containing Chinese and English papers, PPT, multi-layout magazines, contracts, books, exams, ancient books and research reports using RT-DETR-L. The layout detection model includes 1 category: Region.

ModelmAP(0.5) (%)
PP-DocBlockLayout95.9

Note: the evaluation set of the above precision indicators is the self built version sub area detection data set, including Chinese and English papers, magazines, newspapers, research reports PPT、 1000 document type pictures such as test papers and textbooks.

Model Usage

import requests
from PIL import Image
from transformers import AutoImageProcessor, AutoModelForObjectDetection

model_path = "PaddlePaddle/PP-DocBlockLayout_safetensors"
model = AutoModelForObjectDetection.from_pretrained(model_path)
image_processor = AutoImageProcessor.from_pretrained(model_path)

image = Image.open(requests.get("https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/layout.jpg", stream=True).raw)
inputs = image_processor(images=image, return_tensors="pt")

outputs = model(**inputs)
results = image_processor.post_process_object_detection(outputs, target_sizes=[image.size[::-1]])
for result in results:
    for score, label_id, box in zip(result["scores"], result["labels"], result["boxes"]):
        score, label = score.item(), label_id.item()
        box = [round(i, 2) for i in box.tolist()]
        print(f"{model.config.id2label[label]}: {score:.2f} {box}")

Quellen

1 Quelle
Hugging FacePrimärVersion 1fc8f5ec4de2dec8012a04bb5681680ef805dc9d
huggingface.co/PaddlePaddle/PP-DocBlockLayout_safetensors/tree/1fc8f5ec4de2dec8012a04bb5681680ef805dc9d

Verifiziert 27. Aug.

Modellartefakte

1 Artefakt

model.safetensors

safetensors · 126 MB · SHA-256 c0cfb2a5c196…8350 · Hugging Face

Herunterladen

Quellenauszüge

2 Auszüge

--- license: apache-2.0 library_name: PaddleOCR language: - en - zh pipeline_tag: image-to-text tags: - OCR - PaddlePaddle - PaddleOCR - layout_detection --- # PP-DocBlockLayout ## Introduction A layout block localization model trained on a self-built dataset containing Chinese and English papers, PPT, multi-layout magazines, contracts, books, exams, ancient books and research reports using RT-DETR-L. The layout detection model includes 1 category: Region. | Model| mAP(0.5) (%) | | --- | --- | |PP-DocBlockLayout | 95.9 | **Note**: the evaluation set of the above precision indicators is the self built version sub area detection data set, including Chinese and English papers, magazines, newspapers, research reports PPT、 1000 document type pictures such as test papers and textbooks. ## Model Usage ```python import requests from PIL import Image from transformers import AutoImageProcessor, AutoModelForObjectDetection model_path = "PaddlePaddle/PP-DocBlockLayout_safetensors" model = AutoModelForObjectDetection.from_pretrained(model_path) image_processor = AutoImageProcessor.from_pretrained(model_path) image = Image.open(requests.get("https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/layout.jpg", stream=True).raw) inputs = image_processor(images=image, return_tensors="pt") outputs = model(**inputs) results = image_processor.post_process_object_detection(outputs, target_sizes=[image.size[::-1]]) for result in results: for score, label_id, box in zip(result["scores"], result["labels"], result["boxes"]): score, label = score.item(), label_id.item() box = [round(i, 2) for i in box.tolist()] print(f"{model.config.id2label[label]}: {score:.2f} {box}") ```

Source context: 49 downloads · 1 likes · Pipeline image-to-text · Library PaddleOCR · Repo PaddlePaddle/PP-DocBlockLayout_safetensors