as showed in the plot YoloNas-l should run much faster than YoloV8-l But when i am testing it my self in google-colab i am getting different results!
#installing pakcages
!pip install super-gradients==3.1.2
!pip install ultralytics
!pip install pytorch_quantization==2.1.3
!pip install boto3
import super_gradients
from ultralytics import YOLO
import time
!mkdir images
%cd ./images
!wget https://qph.cf2.poecdn.net/main-129957940_34140400692_36_1.png
!wget https://deci-pretrained-models.s3.amazonaws.com/sample_images/beatles-abbeyroad.jpg
!wget https://img.freepik.com/free-photo/view-tiger-animal-wild_23-2150374850.jpg
!wget https://www.fonedog.com/images/photo-compress/image-compressor-image.jpg
!wget https://static.addtoany.com/images/dracaena-cinnabari.jpg
!wget https://qph.cf2.poecdn.net/main-129957940_34139995188_34_1.png
!wget https://qph.cf2.poecdn.net/main-129957940_34139020340_37_1.png
%cd /content/images
import glob
types = ['*.png','*.jpg']
images =[]
for typ in types:
for image in glob.glob(typ):
images.append('/content/images/'+image)
print('/content/images'+image)
nas_ult = NAS('yolo_nas_l.pt')
results = nas_ult.val(data='coco8.yaml')
yolov8 = YOLO("yolov8l.yaml")
yolov8 = YOLO("yolov8l.pt")
nas_inf= 0
nas_res=[]
v8_inf = 0
v8_res=[]
for image in images:
nas_ult_preds = nas_ult(image,imgsz=640)
for image in images:
yolov8_predictions = yolov8(image,imgsz=640)
for image in images:
start = time.time()
nas_ult_preds = nas_ult(image,imgsz=640)
end = time.time()
nas_res.append((nas_ult_preds, end-start))
nas_inf += end-start
start = time.time()
yolov8_predictions = yolov8(image,imgsz=640)
end = time.time()
v8_res.append((yolov8_predictions, end-start))
v8_inf += end-start
print('V8 time:',v8_inf)
print('NAS time:',nas_inf)
and this is my resualt
YoloNas-l time: 0.4496428966522217
YoloV8-l time: 0.399261474609375
why its happening?
Its all about
super_gradients
VSultralytics!
just use yoloNAS with