/yolo-nas-onnx

Inference YOLO-NAS ONNX model

Primary LanguagePython

YOLO-NAS ONNX

sample

Image Source: https://www.pinterest.com/pin/784752303797219490/


love onnxruntime-web opencv python c++ javascript

Run YOLO-NAS models with ONNX without using Pytorch. Inferencing YOLO-NAS ONNX models with ONNXRUNTIME or OpenCV DNN.

Generate ONNX Model

Generate YOLO-NAS ONNX model. You can convert the model using the following code after installing super_gradients library.

from super_gradients.training import models

net = models.get("yolo_nas_s", pretrained_weights="coco")
models.convert_to_onnx(model=net, input_shape=(3,640,640), out_path="yolo_nas_s.onnx")

Custom Model

To run custom trained YOLO-NAS model in this project you need to generate custom model metadata. Custom model metadata generated from custom-nas-model-metadata.py to provide additional information from torch model.

Usage

python custom-nas-model-metadata.py -m <CHECKPOINT-PATH> \ # Custom trained YOLO-NAS checkpoint path
                                        -t <MODEL-TYPE> \ # Custom trained YOLO-NAS model type
                                        -n <NUM-CLASSES> # Number of classes

After running that it'll generate metadata (json formated) for you

References