Downloads · 30 days
14
38% of all-time downloads
harness-race/pi-r2-probe
pi-r2-probe is a object detection model from harness-race. Use it when you need objects located in an image. It is set up for transformers. The card lists the license as apache-2.0.
Object detection model fine-tuned from facebook/detr-resnet-50 (Apache-2.0) on the biglam/locbeyondwords dataset (CC0): crowd-sourced bounding-box annotations of World War I-era newspaper pages from the Library of Con…
Downloads · 30 days
14
38% of all-time downloads
All-time downloads
37
Public
Parameters
41.6M
167 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors167 MB · 99%
From the Hugging Face model README
Object detection model fine-tuned from facebook/detr-resnet-50
(Apache-2.0) on the biglam/loc_beyond_words
dataset (CC0): crowd-sourced bounding-box annotations of World War I-era newspaper pages
from the Library of Congress Chronicling America collection.
facebook/detr-resnet-50 — license Apache-2.0 (shareable).biglam/loc_beyond_words — license CC0-1.0 (public domain).pixel_mask. Training used random horizontal flips and random scale
(70–100% of the max size).WeightedRandomSampler when building training batches.Evaluated on the biglam/loc_beyond_words validation split (32 images)
with COCO-style IoU-matched metrics (area = all, max detections = 300, NMS IoU threshold 0.75).
| Metric | Value |
|---|---|
| mAP @[0.5:0.95] | 1.843759794973911e-06 |
| mAP @0.50 | 6.675969148985493e-05 |
| mAP @0.75 | 0.0 |
| AR @100 | 0.0021307798481711524 |
Per-class AP @0.50:
| Class | [email protected] |
|---|---|
| Photograph | - |
Raw per-image predictions and this training script are included in this repo (
eval_predictions.json,train_detr.py).
from transformers import AutoImageProcessor, DetrForObjectDetection
from PIL import Image
import torch
repo = "harness-race/pi-r2-probe"
processor = AutoImageProcessor.from_pretrained(repo)
model = DetrForObjectDetection.from_pretrained(repo)
img = Image.open("newspaper_page.jpg").convert("RGB")
inputs = processor(images=img, return_tensors="pt")
with torch.no_grad():
out = model(**inputs)
score_threshold = 0.5
for logits, box in zip(out.logits[0], out.pred_boxes[0]):
prob = logits.softmax(-1)
cls_idx, score = prob[:, :-1].max(-1)
if score.item() > score_threshold:
cx, cy, bw, bh = box.tolist()
W, H = img.size
x1, y1 = (cx - bw/2)*W, (cy - bh/2)*H
x2, y2 = (cx + bw/2)*W, (cy + bh/2)*H
print(model.config.id2label[cls_idx.item()], round(score.item(), 3), [round(x1), round(y1), round(x2), round(y2)])
facebook/detr-resnet-50: Apache-2.0.biglam/loc_beyond_words: CC0-1.0 (Public Domain Dedication).