Image resizing best practices for google vision product search

27 views
Skip to first unread message

Morris Kraicer

unread,
Aug 6, 2019, 1:15:28 PM8/6/19
to cloud-vision-discuss
Would like to know best practices for processing and uploading reference images for vision product search.

I found some documentation here: https://cloud.google.com/vision/docs/supported-files#image_sizing but have more specific questions.

If an image is smaller than 640 x 480, should I upsize it?

Should I add padding to get to exactly 640 x 480 (or 480 x640) or would resizing one dimension to get to the minimum number of pixels be sufficient?

Would like to get all images as "similar" as possible, so that when I submit a query image, the results are not biased towards any kind of size or dimension.

Gurkomal Rao

unread,
Aug 8, 2019, 12:06:02 PM8/8/19
to cloud-vision-discuss

There are both positives and negatives when it comes to image sizes. If the image is smaller than the recommended size, the processing time and bandwidth usage will decrease but the accuracy of the prediction will be lower. If the image is larger than the recommended size, the processing time and bandwidth usage will increase but the accuracy will be higher. 


The recommended sizes provided are the middle ground where they take the best options for processing time, bandwidth usage and accuracy of the prediction. If your image is smaller than the recommended size, it would be best to upscale the image while maintaining the aspect ratio. Similarly, if your image was larger than the recommended size, it would be optimal to downscale the image.


As to whether you should use padding or resizing, adding unnecessary padding will increase processing time and will not increase accuracy therefore it is not recommended, where as resizing (while maintaining original aspect ratio) to meet the documented resolutions is recommended. 


Reply all
Reply to author
Forward
0 new messages