From 94f954eba04726082640d5f7343a12266e042eb1 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 29 Apr 2019 17:57:51 +0200 Subject: [PATCH] updates --- detect.py | 1 + utils/datasets.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index c10f8d8c..7510b138 100644 --- a/detect.py +++ b/detect.py @@ -75,6 +75,7 @@ def detect( det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round() # Print results to screen + print('%gx%g ' % img.shape[2:], end='') # print image size for c in det[:, -1].unique(): n = (det[:, -1] == c).sum() print('%g %ss' % (n, classes[int(c)]), end=', ') diff --git a/utils/datasets.py b/utils/datasets.py index 9450fbc6..6b406916 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -75,7 +75,6 @@ class LoadImages: # for inference # Padded resize img, _, _, _ = letterbox(img0, new_shape=self.height) - print('%gx%g ' % img.shape[:2], end='') # print image size # Normalize RGB img = img[:, :, ::-1].transpose(2, 0, 1) # BGR to RGB @@ -114,6 +113,7 @@ class LoadWebcam: # for inference assert ret_val, 'Webcam Error' img_path = 'webcam_%g.jpg' % self.count img0 = cv2.flip(img0, 1) # flip left-right + print('webcam %g: ' % self.count, end='') # Padded resize img, _, _, _ = letterbox(img0, new_shape=self.height) @@ -144,7 +144,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing for x in self.img_files] # Rectangular Training https://github.com/ultralytics/yolov3/issues/232 - self.train_rectangular = False + self.train_rectangular = True if self.train_rectangular: bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index nb = bi[-1] + 1 # number of batches