File size: 799 Bytes
454ccb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
license: apache-2.0
tags:
  - document-layout
  - object-detection
  - yolo
library_name: ultralytics
---

# DocLayout-YOLO - Docstructbench

Document layout detection model. Paper: [DocLayout-YOLO](https://arxiv.org/abs/2410.12628)

## Classes (10)

- `title`
- `plain_text`
- `abandon`
- `figure`
- `figure_caption`
- `table`
- `table_caption`
- `table_footnote`
- `isolate_formula`
- `formula_caption`

## Usage

```python
pip install anyformat-doclayout
```

```python
from anyformat.doclayout import DocLayoutModel, download_converted

# Download weights from this repo
weights = download_converted("docstructbench")

# Run inference
model = DocLayoutModel(weights)
results = model.predict("document.png")

for det in results:
    print(f"{det['class_name']}: {det['confidence']:.2f}")
```