Downloads · 30 days
329
10% of all-time downloads
Ooredoo-Group/ooredoo-stamp-detection
ooredoo-stamp-detection is a object detection model from Ooredoo-Group. Use it when you need objects located in an image. The card lists the license as apache-2.0.
A fine-tuned YOLOS model for detecting stamps in documents.
Downloads · 30 days
329
10% of all-time downloads
All-time downloads
3.3K
Public
Parameters
30.7M
123 MB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors123 MB · 100%
From the Hugging Face model README
A fine-tuned YOLOS model for detecting stamps in documents.
This model is based on hustvl/yolos-small and fine-tuned for single-class stamp detection in documents. It can identify and localize stamps with high accuracy.
from transformers import AutoImageProcessor, AutoModelForObjectDetection
from PIL import Image
import torch
# Load model
processor = AutoImageProcessor.from_pretrained("Ooredoo-Group/ooredoo-stamp-detection")
model = AutoModelForObjectDetection.from_pretrained("Ooredoo-Group/ooredoo-stamp-detection")
# Inference
image = Image.open("document_with_stamp.jpg")
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
# Post-process results
target_sizes = torch.tensor([image.size[::-1]])
results = processor.post_process_object_detection(outputs, target_sizes=target_sizes)[0]
# Display results
for score, label, box in zip(results["scores"], results["labels"], results["boxes"]):
print(f"Detected stamp with confidence {score:.2f}")
print(f"Bounding box: {box}")
Ooredoo-Group
Apache-2.0