Files
frigate/notebooks/YOLO_NAS_Pretrained_Export.ipynb
T
Josh HawkinsandGitHub 2cfb530dbf
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
CI / AMD64 Build (push) Has been cancelled
fix yolonas colab notebook (#22936)
2026-04-21 11:08:10 -06:00

2.5 KiB

Before running: go to Runtime → Change runtime type → Fallback runtime version: 2025.07 (Python 3.11). The current Colab default (Python 3.12+) is incompatible with super-gradients.

In [ ]:
! pip install -q "jedi>=0.16"
! pip install -q git+https://github.com/Deci-AI/super-gradients.git
In [ ]:
! sed -i 's/sghub\.deci\.ai/d2gjn4b69gu75n.cloudfront.net/g; s/sg-hub-nv\.s3\.amazonaws\.com/d2gjn4b69gu75n.cloudfront.net/g' /usr/local/lib/python*/dist-packages/super_gradients/training/pretrained_models.py
! sed -i 's/sghub\.deci\.ai/d2gjn4b69gu75n.cloudfront.net/g; s/sg-hub-nv\.s3\.amazonaws\.com/d2gjn4b69gu75n.cloudfront.net/g' /usr/local/lib/python*/dist-packages/super_gradients/training/utils/checkpoint_utils.py
In [ ]:
from super_gradients.common.object_names import Models
from super_gradients.conversion import DetectionOutputFormatMode
from super_gradients.training import models

model = models.get(Models.YOLO_NAS_S, pretrained_weights="coco")
In [ ]:
# export the model for compatibility with Frigate

model.export("yolo_nas_s.onnx",
             output_predictions_format=DetectionOutputFormatMode.FLAT_FORMAT,
             max_predictions_per_image=20,
             num_pre_nms_predictions=300,
             confidence_threshold=0.4,
             input_image_shape=(320,320),
            )
In [ ]:
from google.colab import files

files.download('yolo_nas_s.onnx')