Update `dataset_stats()` to `cv2.INTER_AREA` (#5821)

pull/5741/head^2
Glenn Jocher 2021-11-29 13:15:36 +01:00 committed by GitHub
parent 8277033b65
commit 5ca5dd4c87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -974,7 +974,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profil
im_height, im_width = im.shape[:2]
r = max_dim / max(im_height, im_width) # ratio
if r < 1.0: # image too large
im = cv2.resize(im, (int(im_width * r), int(im_height * r)), interpolation=cv2.INTER_LINEAR)
im = cv2.resize(im, (int(im_width * r), int(im_height * r)), interpolation=cv2.INTER_AREA)
cv2.imwrite(str(f_new), im)
zipped, data_dir, yaml_path = unzip(Path(path))