Unverified 提交 d5b21b1e authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

HUB dataset previews to JPEG (#5627)

@kalenmike per our convo yesterday.
上级 def7a0fd
...@@ -965,7 +965,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profil ...@@ -965,7 +965,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False, profil
r = max_dim / max(im.height, im.width) # ratio r = max_dim / max(im.height, im.width) # ratio
if r < 1.0: # image too large if r < 1.0: # image too large
im = im.resize((int(im.width * r), int(im.height * r))) 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 except Exception as e: # use OpenCV
print(f'WARNING: HUB ops PIL failure {f}: {e}') print(f'WARNING: HUB ops PIL failure {f}: {e}')
im = cv2.imread(f) im = cv2.imread(f)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论