Registry / ai-ml / doclayout-yolo

doclayout-yolo

JSON →
library0.0.4pypypiunverified

DocLayout-YOLO is an efficient and robust document layout analysis method based on YOLO, optimized for detecting document elements like text, tables, figures, and titles. Current version 0.0.4, pre-release stage with irregular cadence.

pip install doclayout-yolo
INSTALL
IMPORT
SIG · DOCLAYOUT-YOLO
D
doclayout-yolo
ai-mlpythonv0.0.4
Install
92.7s avg
Import
Disk
5495MB
Pass rate
3/ 10
Env Coverage3 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 105.7s
py 3.11
✕ build_error
✕ build_error
py 3.12
✕ build_error
✓ 89s
py 3.13
✕ build_error
✓ 83.4s
py 3.9
✕ build_error
✕ timeout
5495MB installed
● package 5495MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

detect_layout
from doclayout_yolo import detect_layout
from doclayout_yolo import detect_layout

Detect document layout elements (e.g., text, table, figure) in an image. The function returns a list of detected objects with bounding boxes and labels.

from doclayout_yolo import detect_layout # Replace with your image path image_path = 'document.jpg' results = detect_layout(image_path) print(results)
Debug
Known issues
gotchaModel weights are downloaded automatically on first use. Ensure internet access or pre-download the weights to avoid runtime errors.
fix
Run offline: download model file manually and specify model path via `detect_layout(image, model_path='path/to/model.pt')`.
affects: all
gotchaThe library is in early stage (v0.0.4); the API may change without notice. Pin the exact version in requirements.
fix
Use `pip install doclayout-yolo==0.0.4` and check release notes before upgrading.
affects: <1.0.0
deprecatedThe function `detect_layout` was introduced in v0.0.2; older versions required direct import of `DocLayoutYOLO` class and manual inference.
fix
Upgrade to >=0.0.2 and use `from doclayout_yolo import detect_layout`.
affects: <0.0.2
Upgrade
Version history
0.0.4latest on PyPI · released Jun 10, 2025
Audit
Dependencies
ultralyticsrequiredCore inference engine; YOLO models are loaded via ultralytics.YOLO.
torchrequiredPyTorch is required by ultralytics for model computation.
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
doclayout-yolo — pip install doclayout-yolo · libregistry