-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set mem_cache_img_min_size to input_size if it's none #3842
base: develop
Are you sure you want to change the base?
Set mem_cache_img_min_size to input_size if it's none #3842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the prompt update!
37b39a3
to
45f345c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate why you changed max
-> min
?
max
might be semantically right as the cache would downscale if input image is larger than the criteria which is the upper limit.
I thought, but when I applied to set |
Do you upscale small input image if it's smaller than the Cache should generally have 'upper' bound than 'lower' bound.
In sum, it would be better to change parameter value, not the semantic logic of memcache. |
Summary
This PR inlcudes
update_mem_cache_img_max_size
toupdate_mem_cache_img_min_size
update_mem_cache_img_min_size
to value ofinput_size
if it'sNone
.update_mem_cache_img_min_size
to None if tilingDetails
change
update_mem_cache_img_max_size
toupdate_mem_cache_img_min_size
The reason why trying to resize image smaller before caching is to reduce image save size for mem cache.
And it should be bigger than final image size after transforms. If not, some image information can't be distorted or removed.
But current
update_mem_cache_img_max_size
implementation is focusing on maximum input size while keeping image ratio.It means that if image shape is (100, 1000) and
update_mem_cache_img_max_size
is (200, 200) then image is resized to (20, 200) which can make unexpected result.This PR changes it to guarantee that image isn't resized smaller than
update_mem_cache_img_min_size
set
update_mem_cache_img_min_size
to None if tilingtiling task needs to tile original images, so if image is resized before caching, it makes problem while tiling data processing.
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.