From 9885903baf3435d8f3de1a0648d47e17ff05e241 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 20 Mar 2019 20:31:09 +0200 Subject: [PATCH] updates --- utils/datasets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index 8611835e..0cd86dd2 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -73,7 +73,7 @@ class LoadWebcam: # for inference ret_val, img0 = self.cam.read() assert ret_val, 'Webcam Error' img_path = 'webcam_%g.jpg' % self.count - img0 = cv2.flip(img0, 1) + img0 = cv2.flip(img0, 1) # flip left-right # Padded resize img, _, _, _ = letterbox(img0, height=self.height) @@ -155,7 +155,10 @@ class LoadImagesAndLabels: # for training # Load labels if os.path.isfile(label_path): - labels0 = np.loadtxt(label_path, dtype=np.float32).reshape(-1, 5) + # labels0 = np.loadtxt(label_path, dtype=np.float32).reshape(-1, 5) # SLOWER + with open(label_path, 'r') as file: + lines = file.read().splitlines() + labels0 = np.array([x.split() for x in lines], dtype=np.float32) # Normalized xywh to pixel xyxy format labels = labels0.copy()