This commit is contained in:
Glenn Jocher 2019-09-19 00:37:22 +02:00
parent 975b657262
commit 2f436d499a
1 changed files with 1 additions and 1 deletions

View File

@ -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'