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