updates
This commit is contained in:
parent
975b657262
commit
2f436d499a
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue