diff --git a/utils/datasets.py b/utils/datasets.py index 0116d38e..775af08f 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -334,7 +334,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing f = '%s%sclassifier%s%g_%g_%s' % (p.parent.parent, os.sep, os.sep, x[0], j, p.name) if not os.path.exists(Path(f).parent): os.makedirs(Path(f).parent) # make new output folder - box = xywh2xyxy(x[1:].reshape(-1, 4)).ravel() + box = xywh2xyxy(x[1:].reshape(-1, 4) * np.array([1, 1, 1.5, 1.5])).ravel() b = np.clip(box, 0, 1) # clip boxes outside of image ret_val = cv2.imwrite(f, img[int(b[1] * h):int(b[3] * h), int(b[0] * w):int(b[2] * w)]) assert ret_val, 'Failure extracting classifier boxes'