From 0e52b8f361f14ab0e0c7ba6972c9062e4ca058ac Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 19 Sep 2019 19:09:59 +0200 Subject: [PATCH] updates --- detect.py | 4 ++-- utils/datasets.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index 826785ce..5e199a8d 100644 --- a/detect.py +++ b/detect.py @@ -47,7 +47,7 @@ def detect(save_txt=False, save_img=False): # Set Dataloader vid_path, vid_writer = None, None if webcam: - view_img = True + # view_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) else: @@ -131,7 +131,7 @@ if __name__ == '__main__': parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path') parser.add_argument('--data', type=str, default='data/coco.data', help='coco.data file path') parser.add_argument('--weights', type=str, default='weights/yolov3-spp.weights', help='path to weights file') - parser.add_argument('--source', type=str, default='data/samples', help='source') # input file/folder, 0 for webcam + parser.add_argument('--source', type=str, default='rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa', help='source') # input file/folder, 0 for webcam parser.add_argument('--output', type=str, default='output', help='output folder') # output folder parser.add_argument('--img-size', type=int, default=416, help='inference size (pixels)') parser.add_argument('--conf-thres', type=float, default=0.3, help='object confidence threshold') diff --git a/utils/datasets.py b/utils/datasets.py index 15e27d5a..e3804711 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -193,6 +193,8 @@ class LoadStreams: # multiple IP or RTSP cameras if os.path.isfile(sources): with open(sources, 'r') as f: sources = [x.strip() for x in f.read().splitlines() if len(x.strip())] + else: + sources = [sources] n = len(sources) self.imgs = [None] * n