Instructions to use callumtilbury/bobnet-yolov26n with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use callumtilbury/bobnet-yolov26n with ultralytics:
from ultralytics import YOLOvv26 model = YOLOvv26.from_pretrained("callumtilbury/bobnet-yolov26n") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - YOLOv26
How to use callumtilbury/bobnet-yolov26n with YOLOv26:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
BobNet YOLOv26n โ Microbubble Detection
Single-class detection model for microbubbles in optical microscopy images, distilled from a Cellpose-SAM teacher via pseudolabels.
Usage
from ultralytics import YOLO
import math
model = YOLO("callumtilbury/bobnet-yolov26n/best.pt")
results = model.predict("image.png", conf=0.34, max_det=300)
# Convert bbox to diameter
PIXEL_SIZE_UM = 0.0825
for r in results:
for box in r.boxes.xywh.cpu().numpy():
w, h = box[2], box[3]
d_px = (min(w, h) + math.sqrt(w * h)) / 2
d_um = d_px * PIXEL_SIZE_UM
print(f"diameter = {d_um:.2f} um")
Metrics
| Metric | Value |
|---|---|
| diameter_mape | 1.10% |
| count_pct_diff | 4.25% |
| best_conf | 0.34 |
| model | yolo26n |
| n_train_images | 81 |
| epochs | 200 |
Diameter Formula
Blended bbox-to-circle: d_px = (min(w,h) + sqrt(w*h)) / 2, then d_um = d_px * 0.0825.
This formula was empirically shown to outperform mask-based equivalent diameters because rectangular mask artifacts inflate the equivalent diameter.
Domain Caveat
This model is trained on pseudolabels from a specific optical microscope setup. Do not expect generalisation to other microscopes, magnifications, or imaging modalities without retraining or domain adaptation.
Training
- Architecture: yolo26n (pretrained on COCO, fine-tuned on bobnet-bubbles)
- Dataset:
callumtilbury/bobnet-bubbles(81 train images, 20 val images) - Phase 1: 200 epochs, lr0=0.002, imgsz=640, batch=8, patience=50
- Phase 2: 50 epochs, lr0=0.0005 fine-tune from best Phase 1 checkpoint
- Teacher: Cellpose-SAM (not included; pseudolabels only)
- Downloads last month
- 18
from ultralytics import YOLOvv26 model = YOLOvv26.from_pretrained("callumtilbury/bobnet-yolov26n") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True)