Detector¶
MinerU VL layout detector.
Uses MinerU2.5-2509-1.2B for document layout detection. Detects 22+ element types including text, titles, tables, equations, figures, code.
MinerUVLLayoutDetector
¶
Bases: BaseLayoutExtractor
MinerU VL layout detector.
Uses MinerU2.5-2509-1.2B for document layout detection. Detects 22+ element types including text, titles, tables, equations, figures, code, and more.
For full document extraction (layout + content), use MinerUVLTextExtractor from the text_extraction module instead.
Example
from omnidocs.tasks.layout_extraction import MinerUVLLayoutDetector
from omnidocs.tasks.layout_extraction.mineruvl import MinerUVLLayoutPyTorchConfig
detector = MinerUVLLayoutDetector(
backend=MinerUVLLayoutPyTorchConfig(device="cuda")
)
result = detector.extract(image)
for box in result.bboxes:
print(f"{box.label}: {box.confidence:.2f}")
Initialize MinerU VL layout detector.
| PARAMETER | DESCRIPTION |
|---|---|
backend
|
Backend configuration (PyTorch, VLLM, MLX, or API)
TYPE:
|
Source code in omnidocs/tasks/layout_extraction/mineruvl/detector.py
extract
¶
Detect layout elements in the image.
| PARAMETER | DESCRIPTION |
|---|---|
image
|
Input image (PIL Image, numpy array, or file path)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
LayoutOutput
|
LayoutOutput with standardized labels and bounding boxes |