Browse Source

HUB dataset previews to JPEG (#5627)

@kalenmike per our convo yesterday.
modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
d5b21b1ecb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/datasets.py

+ 1
- 1
utils/datasets.py View File

@@ -965,7 +965,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profil
r = max_dim / max(im.height, im.width) # ratio
if r < 1.0: # image too large
im = im.resize((int(im.width * r), int(im.height * r)))
im.save(f_new, quality=75) # save
im.save(f_new, 'JPEG', quality=75, optimize=True) # save
except Exception as e: # use OpenCV
print(f'WARNING: HUB ops PIL failure {f}: {e}')
im = cv2.imread(f)

Loading…
Cancel
Save