diff --git a/detect.py b/detect.py index 56194118..3e17e254 100644 --- a/detect.py +++ b/detect.py @@ -54,6 +54,14 @@ def detect(save_txt=False, save_img=True, stream_img=False): else: dataloader = LoadImages(opt.source, img_size=img_size, half=opt.half) + # Attempt stream_img: + if stream_img: + try: + cv2.imshow('', np.zeros((480, 640, 3))) + cv2.destroyAllWindows() + except: + stream_img = False # Possible SSH connection, do not stream + # Get classes and colors classes = load_classes(parse_data_cfg(opt.data)['names']) colors = [[random.randint(0, 255) for _ in range(3)] for _ in range(len(classes))]