Skip to content

modern-yolonas

A clean, minimal Python reimplementation of YOLO-NAS object detection. No factory patterns, no registries, no OmegaConf — just PyTorch.

YOLO-NAS-L detections on a street scene

Features

  • Drop-in pretrained weights — loads super-gradients COCO checkpoints directly
  • Simple API — YoloNASDetector("yolo_nas_s") → call with an image → get sv.Detections
  • Ecosystem native — results are supervision Detections: slice to filter, and plug into its annotators, trackers and zones
  • Embeddings and tracking in the detection pass — per-object vectors and Deep HM-SORT ids for one forward pass per frame
  • CLI — yolonas detect, yolonas track, yolonas train, yolonas export, yolonas eval
  • ONNX / OpenVINO export — including Frigate-compatible graph surgery
  • Training — full training loop with DDP, AMP, EMA, cosine LR
  • All 3 variants — S (19.05M), M (51.18M), L (66.98M)

Quick install

pip install modern-yolonas

Minimal example

import cv2
from modern_yolonas import YoloNASDetector

det = YoloNASDetector("yolo_nas_s")

image = cv2.imread("image.jpg")
detections = det(image)
cv2.imwrite("output.jpg", det.annotate(image, detections))

Next steps