Instructions to use anyformat/doclayout-yolo-docstructbench with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use anyformat/doclayout-yolo-docstructbench with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("anyformat/doclayout-yolo-docstructbench") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
| 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}") | |
| ``` | |