From 927f312d169c10bd2c73a899bdf26f2a5d6ace69 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 12 Nov 2021 11:58:10 +0100 Subject: [PATCH] HUB dataset previews to JPEG @kalenmike per our convo yesterday. --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 1ecc7440119f..2a6653bfc02c 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -965,7 +965,7 @@ def hub_ops(f, max_dim=1920): 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)