This commit is contained in:
Glenn Jocher 2019-09-10 21:25:01 +02:00
parent 2a75034322
commit a31b1489a4
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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