mrdbourke / nutrify

Take a photo of food and learn about it.
https://nutrify.app
MIT License
182 stars 35 forks source link

Go through `all_images` on Google Storage and resize them to take up less space #69

Open mrdbourke opened 1 year ago

mrdbourke commented 1 year ago

JPEG images don't have to be 100% quality in storage.

The models only train on images of sizes 224, 299, 384 etc...

So could potentially resize all images to only be at max 1000x1000?

Go through images and downsize if:

Benefits:

mrdbourke commented 1 year ago

Doesn't look like I need to do this...

Experiments show that it doesn't change much.

Without resizing:

Min load time: 6.175041198730469e-05
Max load time: 0.0051898956298828125
Mean load time: 7.927996739415816e-05
Median load time: 7.2479248046875e-05

With resizing (all images to (600, 600)):

Min load time: 6.628036499023438e-05
Max load time: 0.0004761219024658203
Mean load time: 7.431405741298758e-05
Median load time: 7.224082946777344e-05

Results:

Original images mean load time: 7.927996739415816e-05
Resized images mean load time: 7.431405741298758e-05
Resized images load time is 1.0668232923089287 times faster than original images