From a31b1489a42511ba06f5db4f9b1b3470be0c3290 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 10 Sep 2019 21:25:01 +0200 Subject: [PATCH] updates --- detect.py | 1 + utils/datasets.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index df79f625..475a2321 100644 --- a/detect.py +++ b/detect.py @@ -48,6 +48,7 @@ def detect(save_txt=False, save_img=False, stream_img=False): # Set Dataloader vid_path, vid_writer = None, None if streams: + stream_img = True torch.backends.cudnn.benchmark = True # set True to speed up constant image size inference dataset = LoadStreams(source, img_size=img_size, half=half) elif webcam: diff --git a/utils/datasets.py b/utils/datasets.py index 85ce9795..0ceae059 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -35,7 +35,7 @@ def exif_size(img): elif rotation == 8: # rotation 90 s = (s[1], s[0]) except: - None + pass return s @@ -190,7 +190,7 @@ class LoadStreams: # multiple IP or RTSP cameras self.img_size = img_size self.half = half # half precision fp16 images with open(path, 'r') as f: - sources = f.read().splitlines() + sources = [x.strip() for x in f.read().splitlines() if len(x.strip())] n = len(sources) self.imgs = [None] * n