Skip to content

Commit

Permalink
HUB dataset previews to JPEG (#5627)
Browse files Browse the repository at this point in the history
@kalenmike per our convo yesterday.
  • Loading branch information
glenn-jocher committed Nov 12, 2021
1 parent def7a0f commit d5b21b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d5b21b1

Please sign in to comment.