archival-index-card-detector
7
4
license:agpl-3.0
by
NationalLibraryOfScotland
Image Model
OTHER
New
7 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
Cropping detected cardspython
from ultralytics import YOLO
from PIL import Image
model = YOLO(hf_hub_download(
repo_id="NationalLibraryOfScotland/archival-index-card-detector",
filename="model.pt"
))
image = Image.open("scan.jpg")
results = model.predict(image)
for i, box in enumerate(results[0].boxes):
x1, y1, x2, y2 = box.xyxy[0].tolist()
# Add padding (10%)
w, h = x2 - x1, y2 - y1
pad = 0.1
x1 = max(0, x1 - w * pad)
y1 = max(0, y1 - h * pad)
x2 = min(image.width, x2 + w * pad)
y2 = min(image.height, y2 + h * pad)
cropped = image.crop((x1, y1, x2, y2))
cropped.save(f"card_{i}.jpg")Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.