I am testing yolov8 prediction using the following code:
from ultralytics import YOLO
# Load a model
model = YOLO("yolov8n.pt")
# Use the model
model.predict(source= "bus.jpg",show=True) # predict on an image
This works perfectly in the Spyder IDE and the resulting image can be closed by clicking the toprighthand corner in the usual way.
Using the same code in a Jupter notebook also works but the image cannot be closed. Clicking on the image gives the popup message that Python is not responding, offering the choice of closing the program or waiting. AS expected clsing the program kills the kernel. Is there a way round this?