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

Wrong validation image viewing path in YOLOv8 object detection training notebook #293

Closed ukicomputers closed 3 months ago

ukicomputers commented 4 months ago

Search before asking

Notebook name

train-yolov8-object-detection-on-custom-dataset.ipynb

Bug

In following section (in the notebook):

Inference with Custom Model

... NOTE: Let's take a look at few results.

import glob
from IPython.display import Image, display

for image_path in glob.glob(f'{HOME}/runs/detect/predict3/*.jpg')[:3]:
     display(Image(filename=image_path, width=600))
     print("\n")

In noted Python code, directory set in glob is set to predict3 (someone got it wrong because they ran train/detection multiple times, and by default, every new train/detection directory in that dir is set by index, so they set to latest "index"). It should be just predict, the default index (see below).

import glob
from IPython.display import Image, display

for image_path in glob.glob(f'{HOME}/runs/detect/predict/*.jpg')[:3]:
      display(Image(filename=image_path, width=600))
      print("\n")

Environment

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

SkalskiP commented 4 months ago

Hi @ukicomputers 👋🏻 thanks for pointing this out! I noticed that you checked Yes I'd like to help by submitting a PR!. Feel free to submit PR with the fix.

SkalskiP commented 3 months ago

This issue was solved via https://github.com/roboflow/notebooks/pull/295.