NationalLibraryOfScotland/nls-index-cards-object-detection
Viewer • Updated • 100 • 105 • 1
How to use davanstrien/archival-index-card-detector-v4 with ultralytics:
# Couldn't find a valid YOLO version tag.
# Replace XX with the correct version.
from ultralytics import YOLOvXX
model = YOLOvXX.from_pretrained("davanstrien/archival-index-card-detector-v4")
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)A YOLO26n model trained to detect index cards in digitized archival document scans. This is a development version for validation before promoting to the NationalLibraryOfScotland/archival-index-card-detector repo.
| Metric | v3 | v4 | Delta |
|---|---|---|---|
| mAP@50 | 99.3% | 99.5% | +0.2% |
| mAP@50-95 | 87.5% | 99.2% | +11.7% |
| Precision | 99.9% | 100% | +0.1% |
| Recall | 98.9% | 98.9% | same |
Best epoch: 59/100 (early stopping at 79, patience=20).
from ultralytics import YOLO
from huggingface_hub import hf_hub_download
model = YOLO(hf_hub_download(
repo_id="davanstrien/archival-index-card-detector-v4",
filename="model.pt"
))
results = model.predict("scan.jpg")
for result in results:
for box in result.boxes:
x1, y1, x2, y2 = box.xyxy[0].tolist()
confidence = box.conf[0].item()
print(f"Card at ({x1:.0f}, {y1:.0f}, {x2:.0f}, {y2:.0f}) conf={confidence:.2f}")
Development/validation - pending comparison against v3 on late-range images before promotion to the NLS org repo.