This commit is contained in:
Glenn Jocher 2019-02-11 17:25:32 +01:00
parent be2c70106b
commit 585f2e2cc1
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ def detect(
# Set Dataloader # Set Dataloader
if webcam: if webcam:
save_images = False save_images = False
dataloader = LoadWebcam(images, img_size=img_size) dataloader = LoadWebcam(img_size=img_size)
else: else:
dataloader = LoadImages(images, img_size=img_size) dataloader = LoadImages(images, img_size=img_size)
@ -50,7 +50,7 @@ def detect(
for i, (path, img, im0) in enumerate(dataloader): for i, (path, img, im0) in enumerate(dataloader):
t = time.time() t = time.time()
print("%g/%g '%s': " % (i + 1, len(dataloader), path), end='') print("%g/%g '%s': " % (i + 1, len(dataloader), path if not webcam else 'webcam'), end='')
save_path = os.path.join(output, path.split('/')[-1]) save_path = os.path.join(output, path.split('/')[-1])
# Get detections # Get detections

View File

@ -56,7 +56,7 @@ class LoadImages: # for inference
class LoadWebcam: # for inference class LoadWebcam: # for inference
def __init__(self, path, img_size=416): def __init__(self, img_size=416):
self.cam = cv2.VideoCapture(0) self.cam = cv2.VideoCapture(0)
self.nF = 9999 # number of image files self.nF = 9999 # number of image files
self.height = img_size self.height = img_size