From f8994e89ea1e447b42987fdb98dbc04537ef4dd4 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 20 Mar 2019 19:20:54 +0200 Subject: [PATCH] updates --- utils/datasets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index 40d935d2..0a44d327 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -208,8 +208,8 @@ class LoadImagesAndLabels: # for training # Normalize img_all = np.stack(img_all)[:, :, :, ::-1].transpose(0, 3, 1, 2) # BGR to RGB and cv2 to pytorch - img_all = np.ascontiguousarray(img_all, dtype=np.float32) - img_all /= 255.0 + img_all = np.ascontiguousarray(img_all, dtype=np.float32) # int8 to float32 + img_all /= 255.0 # 0 - 255 to 0.0 - 1.0 labels_all = torch.from_numpy(np.concatenate(labels_all, 0)) return torch.from_numpy(img_all), labels_all, img_paths, img_shapes