small-models-for-glam/archival-index-card-detector
Archival Index Card Detector
A YOLO26n object detector for archival index cards. Upload any archival scan — a single card, a multi-card sheet, or a full archival page — and the model will draw a box around every card it finds.
What it's for
The model handles the detection / localisation step in a typical archival processing pipeline:
full archival page scan → this model: where are the cards? → crop each card → OCR / VLM extraction → structured records
It's been trained to work across very different "card" presentations:
- Full archival pages with one or more cards visible (NLS Advocates Library style)
- Multi-card sheets with 2–9 cards stacked or arranged in a grid (US Navy Nurse Corps biographical records)
- Pre-cropped single cards from library catalogs (Boston Public Library) and manuscript catalogs (Duke Rubenstein)
- Handwritten and typed content
- Background / cover pages (returns zero detections — see the binder-cover example)
Performance
Single class (card). Validated on a held-out 285-image set, mAP@50 ≥ 0.99 across all four training collections; mAP@50:95 ≥ 0.977. The 3×3 multi-card grid example in the demo is detected as 9/9 cards with mean confidence 0.98 — the case that motivated the project, where the original NLS-only detector returned zero.
Use the model directly
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
weights = hf_hub_download(
repo_id="small-models-for-glam/index-card-detector-v5",
filename="best.onnx", # or "best.pt"
)
model = YOLO(weights)
results = model.predict("your_scan.jpg", conf=0.25, imgsz=1024)[0]
for box in results.boxes.xyxy.cpu().tolist():
print(box) # [x1, y1, x2, y2] in pixel coords- Model: `small-models-for-glam/index-card-detector-v5`
- Training data: `small-models-for-glam/index-card-detection-v5`
- Base model: `NationalLibraryOfScotland/archival-index-card-detector`
Limitations & feedback
Trained on English-language US/UK archival material. The model may over-predict on newspaper clippings or photographs that appear in mixed archival scans (we have very few non-card negatives in training). Found a failure case? Open an issue on the model repo with the image — it becomes training data for v6.
Configuration (Space owner)
Set environment variables to point at a different model:
MODEL_REPO— defaults tosmall-models-for-glam/index-card-detector-v5MODEL_FILE— defaults tobest.onnx
