From 7ea0178a6c364fb5da5508de609975c927e6a2c7 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 31 Aug 2019 21:19:02 +0200 Subject: [PATCH] updates Signed-off-by: Glenn Jocher --- detect.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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))]