Introducing
fotonet v2
Hi Bird
37.5 AP 2.27 msTRT NMS-free
[1] Introduction
Introduction
fotonet v2 (Hi Bird) is a new object detector, designed and trained from scratch on COCO alone. Its first release, fotonet2n, unites foldable convolutions, area attention, a linear hypergraph neck and sparse geometric query refinement in a 5.98 MB Apache-2.0 checkpoint with custom Triton CUDA kernels built in. Pretrained weights are live now; dive into the v2 model docs and architecture guide.
- 2.69M deployed parameters
- 6.41 GFLOPs at 640 px
- 37.5AP COCO mAP50-95 · 300 epochs
- Free Apache-2.0, forever
[2] Nano peer comparison
Against the nano field.
Every model below was evaluated on the exact same RTX 4060, the same official pycocotools COCO val2017 split (all 5,000 images at 640 × 640) and the same TensorRT 10.16 harness. Hi Bird trains from random weights in 300 epochs on a single GPU with zero borrowed weights.1 Benchmark protocol.
| Measure | fotonet2n (v2) | fotonetn (v1.2) | YOLO26n | YOLO12n | YOLO11n | YOLOv10n |
|---|---|---|---|---|---|---|
| COCO mAP50-95All 5,000 val2017 images | 37.50 AP300 ep · 1× RTX 4060 | 32.55 AP | 40.25 AP | 39.96 AP | 38.73 AP | 38.37 AP |
| AP50IoU 0.50 threshold | 55.57 AP | 48.11 AP | 55.79 AP | 55.54 AP | 54.21 AP | 53.44 AP |
| AP75Strict localization | 40.04 AP | 35.25 AP | 43.60 AP | 43.23 AP | 42.15 AP | 41.72 AP |
| APS / APM / APLSmall · medium · large | 19.6 / 40.8 / 51.5 | 17.1 / 35.7 / 45.4 | 19.7 / 44.2 / 58.3 | 19.7 / 44.2 / 57.6 | 19.6 / 42.5 / 56.1 | 19.0 / 42.1 / 54.8 |
| ParametersDeployed graph | 2.69M | 2.85M | 2.41M | 2.59M | 2.62M | 2.30M |
| Computethop GFLOPs at 640 × 640 | 6.41 GFLOPs | 6.87 GFLOPs | 5.36 GFLOPs | 6.49 GFLOPs | 6.48 GFLOPs | 6.70 GFLOPs |
| PyTorch FP16RTX 4060, batch 1 | 2.42 ms | 6.34 ms | 8.38 ms | 9.51 ms | 6.76 ms | 6.37 ms |
| PyTorch End-to-EndBGR frame → boxes, b1 | 3.94 ms | 7.94 ms | 9.07 ms | 10.74 ms | 7.54 ms | 7.39 ms |
| TensorRT FP16RTX 4060, batch 1 / batch 8 | 2.27 msb8: 8.49 ms | 1.23 msb8: 4.74 ms | 1.61 msb8: 5.67 ms | 2.57 msb8: 10.29 ms | 1.44 msb8: 5.91 ms | 1.47 msb8: 5.63 ms |
| ONNX CPU (4T)Batch 1 median | 45.3 ms | 30.8 ms | 33.8 ms | 38.3 ms | 34.1 ms | 31.7 ms |
| Peak VRAMFP16 batch 1 | 74 MB | 45 MB | 80 MB | 54 MB | 54 MB | 51 MB |
| Post-processing | No NMS · Top-300 | No NMS · Dense | No NMS · Top-300 | Needs NMS | Needs NMS | No NMS · Top-300 |
| License | Apache-2.0 | Apache-2.0 | AGPL-3.0 | AGPL-3.0 | AGPL-3.0 | AGPL-3.0 |
Measured on 23 November 2026 on one RTX 4060 (8 GB) with an i3-13100F, Windows 11, CUDA 12.8, PyTorch 2.11, TensorRT 10.16.1 and ONNX Runtime 1.23.2 in a single locked harness with 15 s GPU cooldown between models. All six models ran official pycocotools across all 5,000 COCO val2017 images at 640 × 640 (ultralytics 8.4.38 for YOLO peers with conf=0.001, iou=0.70, max_det=300; fotonet2n uses the released 5.98 MB weights with custom Triton CUDA kernels and CUDA Graph replay; YOLO26n published weights use Objects365 pretraining before COCO).
[3] How fast it learns
It learns FAST.
fotonet v1.2 nano needed 500 epochs to reach 32.1 AP. Hi Bird passes that full-run mark in 50 epochs and reaches 37.5 AP (55.6 AP at IoU 0.50) by the end of a 300-epoch run, with 2.4% duplicate boxes and a 0.00 AP gap to NMS.
- fotonet v2 (Hi Bird)
- fotonet v1.2 nano
- fotonet v1.1 nano
[4] Try it
Live inference demo.
Run the released fotonet2n ONNX model (5.7 MB) directly on your device with WebGPU or WASM. Test on sample scenes, your own photo, live webcam, or video; nothing leaves your browser.
[5] Step 1 · Download & install
Install from PyPI.
One package covers inference, training, COCO validation and export on Python 3.10 to 3.12 across Windows, macOS and Linux. Released fotonet2n (5.98 MB) and fotonetn weights download and cache automatically on first use. Install guide · Migrating from YOLO · GitHub · PyPI.
-
Install the package.
Installs the Python library, the fotonet CLI and pycocotools for COCO mAP evaluation.
pip install fotonet -
Add export tools.
Adds onnx, onnxruntime and onnxsim so every export is simplified and parity-checked against PyTorch.
pip install "fotonet[export]" -
Verify the install.
Downloads the released 5.98 MB fotonet2n weights automatically and prints deployed parameter, GFLOP and runtime info.
fotonet info model=fotonet2n
[6] Step 2 · Run inference
Load and predict. No NMS to tune.
Pass an image, folder, video or OpenCV frame. Because Hi Bird returns 300 sparse queries directly, you set one confidence threshold and read the boxes. See predict docs.
from fotonet import Fotonet
model = Fotonet("fotonet2n") # auto-downloads released 5.98 MB weights
results = model.predict("street.jpg", conf=0.25)
for box in results[0].boxes:
print(box.cls, box.conf, box.xyxy) # pixel corners (x1, y1, x2, y2)
results[0].save("prediction.jpg")
import cv2
from fotonet import Fotonet
model = Fotonet("fotonet2n")
frame = cv2.imread("frame.jpg")
result = model.predict_bgr(frame, conf=0.25)[0]
frames = model.track("video.mp4", tracker="bytetrack", stream=True)
for res in frames:
print(len(res.boxes))
fotonet predict model=fotonet2n source=street.jpg conf=0.25 save=true
fotonet track model=fotonet2n source=video.mp4 tracker=bytetrack
Exported .onnx and .torchscript files load through Fotonet("fotonet2n.onnx") with the exact same API.
-
01
Load any checkpoint or export.
Fotonet("fotonet2n") loads the model on GPU or CPU automatically. Pass a custom .pt, .onnx or .torchscript path to run your own weights.
-
02
One confidence threshold.
Set conf=0.25 and run. There is no IoU threshold to tune because one-to-one query refinement suppresses duplicates inside the network.
-
03
Read boxes, crops or JSON.
Each box carries cls, conf, pixel xyxy / xywh (plus normalized xyxyn / xywhn) and box.transform for padding and cropping, along with result.to_json().
[7] Step 3 · Train your own dataset
Your images. Your classes.
Describe your train and validation splits in one YAML file using YOLO text labels or COCO annotations. Stop and resume at any epoch with full optimizer and EMA state. See training docs.
from fotonet import Fotonet
model = Fotonet("fotonet2n", nc=2)
model.train(
data="data.yaml",
epochs=100,
imgsz=640,
batch=16,
save_dir="runs/custom",
)
metrics = model.val(data="data.yaml")
fotonet train model=fotonet2n data=data.yaml epochs=100 batch=16 imgsz=640 save_dir=runs/custom
fotonet val model=runs/custom/fotonet2n/fotonet2n_best.pt data=data.yaml
from fotonet import Fotonet
model = Fotonet("fotonet2n")
model.train(
data="data.yaml",
epochs=100,
weights="runs/custom/fotonet2n/fotonet2n_last.pt",
resume=True,
save_dir="runs/custom",
)
During training, the auxiliary O2M teacher and 64 denoising queries accelerate convergence, then strip automatically at inference and export.
Define your dataset in one file.
Put normalized class_id cx cy w h rows in parallel labels/ files, or point directly at COCO annotation JSONs.
path: /path/to/dataset
train: images/train
val: images/val
nc: 2
names:
0: helmet
1: vest
Or label, augment and train visually on your desktop with fotonet Studio.
[8] Step 4 · Export & deploy
Export once. Run anywhere.
At export, training-only branches strip and all 119 BatchNorm2d layers fold into single convolutions, writing a 2.69M-parameter [B, 300, nc+4] tensor (nc raw class logits before sigmoid, then normalized cx, cy, w, h in 0..1 letterbox space) plus a JSON metadata sidecar. Export docs · Decode raw output.
from fotonet import Fotonet
model = Fotonet("fotonet2n")
model.export(
format="onnx",
path="fotonet2n.onnx",
imgsz=640,
half=True,
verify=True,
)
from fotonet import Fotonet
model = Fotonet("fotonet2n")
model.export(
format="tensorrt",
path="fotonet2n.engine",
imgsz=640,
batch=1,
half=True,
)
from fotonet import Fotonet
model = Fotonet("fotonet2n")
model.export(format="torchscript", path="fotonet2n.torchscript", imgsz=640)
model.export(format="coreml", path="fotonet2n.mlpackage", imgsz=640, half=True)
fotonet export model=fotonet2n format=onnx path=fotonet2n.onnx imgsz=640
fotonet export model=fotonet2n format=tensorrt path=fotonet2n.engine half=true
Pass dynamic=True for variable resolution or int8=True, calibration_data=batches for calibrated INT8 ONNX.
-
ONNXformat="onnx" · Opset 17
Checked against PyTorch with ONNX Runtime (verify=True). Runs on CPU, CUDA, DirectML, WebGPU and WASM.
-
TensorRTformat="tensorrt" · 2.27 ms RTX 4060
Builds an FP16 or FP32 TensorRT .engine via trtexec with all 300 top queries selected inside the graph.
-
CoreMLformat="coreml" · Experimental
Exports for Apple Silicon and Neural Engine deployment. Validate accuracy and latency on your target Apple device.
-
TorchScriptformat="torchscript" · C++ / LibTorch
Embeds the fused graph, class names and preprocessing settings inside a single archive for Python-free runtimes.