roboflow / notebooks

Examples and tutorials on using SOTA computer vision models and techniques. Learn everything from old-school ResNet, through YOLO and object-detection transformers like DETR, to the latest models like Grounding DINO and SAM.
https://roboflow.com/models
5.58k stars 880 forks source link

Issue in running the Yolo NAS notebook #301

Open Darrshan-Sankar opened 3 months ago

Darrshan-Sankar commented 3 months ago
          Thanks @arrafi-musabbir 🙏🏻 I just updated our YOLO-NAS notebook.

Originally posted by @SkalskiP in https://github.com/roboflow/notebooks/issues/172#issuecomment-1754866035

I wanted to reopen this issue, as i get error for the following code:

import cv2

image = cv2.imread(SOURCE_IMAGE_PATH)
result = list(model.predict(image, conf=0.35))[0]

I get the following error:

TypeError                                 Traceback (most recent call last)
[<ipython-input-8-71f83f1aa3bd>](https://localhost:8080/#) in <cell line: 4>()
      2 
      3 image = cv2.imread(SOURCE_IMAGE_PATH)
----> 4 result = list(model.predict(image, conf=0.35))[0]

TypeError: 'ImageDetectionPrediction' object is not iterable

I ran the following notebook: https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/train-yolo-nas-on-custom-dataset.ipynb in colab