Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2019-09-02 16:41:41 +02:00
parent 109173d555
commit 0d5bf11fa5
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ from utils.datasets import *
from utils.utils import * from utils.utils import *
def detect(save_txt=False, save_img=True, stream_img=False): def detect(save_txt=False, save_img=False, stream_img=False):
img_size = (320, 192) if ONNX_EXPORT else opt.img_size # (320, 192) or (416, 256) or (608, 352) for (height, width) img_size = (320, 192) if ONNX_EXPORT else opt.img_size # (320, 192) or (416, 256) or (608, 352) for (height, width)
out, source, weights, half = opt.output, opt.source, opt.weights, opt.half out, source, weights, half = opt.output, opt.source, opt.weights, opt.half
webcam = source == '0' or source.startswith('rtsp') or source.startswith('http') webcam = source == '0' or source.startswith('rtsp') or source.startswith('http')
@ -48,10 +48,10 @@ def detect(save_txt=False, save_img=True, stream_img=False):
# Set Dataloader # Set Dataloader
vid_path, vid_writer = None, None vid_path, vid_writer = None, None
if webcam: if webcam:
save_img = False
stream_img = True stream_img = True
dataset = LoadWebcam(source, img_size=img_size, half=half) dataset = LoadWebcam(source, img_size=img_size, half=half)
else: else:
save_img = True
dataset = LoadImages(source, img_size=img_size, half=half) dataset = LoadImages(source, img_size=img_size, half=half)
# Get classes and colors # Get classes and colors