---
title: PP-DocBlockLayout_safetensors
canonical_url: "https://www.modelscope.cn/models/PaddlePaddle/PP-DocBlockLayout_safetensors"
md_url: "https://www.modelscope.cn/models/PaddlePaddle/PP-DocBlockLayout_safetensors.md"
repository: PaddlePaddle/PP-DocBlockLayout_safetensors
last_updated: 2026-04-15
license: apache-2.0
model_type:
  - rt_detr
parameters: 32.9M
tensor_type:
  - F32
  - I64
library_name:
  - transformer
  - safetensors
language:
  - en
  - zh
downloads: 286
stars: 0
tags:
  - OCR
  - PaddlePaddle
  - PaddleOCR
  - layout_detection
---

# PP-DocBlockLayout_safetensors

> PP-DocBlockLayout_safetensors - PaddlePaddle 在 ModelScope 开源的模型。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…

PaddlePaddle/PP-DocBlockLayout_safetensors 是 ModelScope 魔搭社区上的 32.9M 参数机器学习模型，采用 apache-2.0 许可。

- **Repository**: PaddlePaddle/PP-DocBlockLayout_safetensors
- **License**: apache-2.0
- **Parameters**: 32.9M
- **Tags**: OCR, PaddlePaddle, PaddleOCR, layout_detection
- **Downloads**: 286
- **Stars**: 0
- **Last updated**: 2026-04-15

Source: https://www.modelscope.cn/models/PaddlePaddle/PP-DocBlockLayout_safetensors

---

# 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}")
```
