Yolo v8 detection auto terminate after 20 seconds
from ultralytics import YOLO model = YOLO(‘best.pt’) results = model(source = 0, show=True, conf=0.4, save= True) The problem with this code is this code continuously runs and it can be terminated by pressing control + c. But i have tried many methods to automatically terminate the code after 20 seconds but none of the techniques […]