YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Docling Model for Layout

This is the Docling model for layout detection, designed to facilitate easy importing and usage like any other Hugging Face model.

This model is part of the Docling repository, which provides document layout analysis tools.

Usage Example

Here's how you can load and use the model:

import torch
from PIL import Image
from transformers import RTDetrForObjectDetection, RTDetrImageProcessor

# Load the model and processor
image_processor = RTDetrImageProcessor.from_pretrained("your-username/your-model-name")
model = RTDetrForObjectDetection.from_pretrained("your-username/your-model-name")

# Load an image
image = Image.open("your-image.png")

# Preprocess the image
inputs = image_processor(images=image, return_tensors="pt")

# Perform inference
with torch.no_grad():
    outputs = model(**inputs)

# Post-process results
results = image_processor.post_process_object_detection(
    outputs, 
    target_sizes=torch.tensor([(image.height, image.width)]), 
    threshold=0.3
)

# Print detected objects
for result in results:
    for score, label_id, box in zip(result["scores"], result["labels"], result["boxes"]):
        score, label = score.item(), label_id.item()
        box = [round(i, 2) for i in box.tolist()]
        print(f"{model.config.id2label[label]}: {score:.2f} {box}")

Model Information

  • Base Model: RT-DETR (Robust Transformer-based Object Detector)
  • Intended Use: Layout detection for documents
  • Framework: Hugging Face Transformers
  • Dataset Used: Internal dataset for document structure recognition
  • License: Apache 2.0

Citing This Model

If you use this model in your work, please cite the main Docling repository:

@misc{docling2024, title={Docling Models for Document Layout Analysis}, author={DS4SD Team}, year={2024}, howpublished={Hugging Face Repository}, url={https://huggingface.co/ds4sd/docling-models} }

For more details, visit the main repo: ds4sd/docling-models.

Contact

For questions or issues, please open a discussion on Hugging Face or contact [pandahd75@gmail.com].

Downloads last month
1
Safetensors
Model size
42.9M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.