DocLayout-YOLO: Enhancing Document Layout Analysis through Diverse Synthetic Data and Global-to-Local Adaptive Perception
Paper โข 2410.12628 โข Published โข 42
Run anyformat/doclayout-yolo-docstructbench on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/anyformat/doclayout-yolo-docstructbench. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/anyformat/doclayout-yolo-docstructbench on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use anyformat/doclayout-yolo-docstructbench with ultralytics:
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
# pick the weights file from this repo's "Files and versions" tab
weights = hf_hub_download("anyformat/doclayout-yolo-docstructbench", "<weights>.pt")
model = YOLO(weights)
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)Document layout detection model. Paper: DocLayout-YOLO
titleplain_textabandonfigurefigure_captiontabletable_captiontable_footnoteisolate_formulaformula_captionpip install anyformat-doclayout
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}")