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
Weird behavior of LongestMaxSize #2123
Comments
Seems like Resize behave similarly when size is an integer. |
@johnnv1 @shijianjian Is this the expected behavior ? |
@twsl Can you take a look? |
Unfortunately I don't have much time right now, but a quick peek at the source code makes me wonder if the resize generator in the resize augmentation does include any checks to recalculate the parameters |
@johnnv1 Can you help fix it if you got some time? |
as @twsl commented, seems for this case we need to recompute the params -- i'm not sure of the best way to try avoid generating the params in each call |
Describe the bug
Hello me again,
I might be doing something wrong with the way I use kornia augmentations, please let me know if it is the case.
I was expecting
LongestMaxSize
in kornia to perform similarily as the albumentation implementation. Meaning that I can throw any images with different shapes to the the transformation function and get an image with different shapes but similar ratios. The largest size being equal to the value given toLongestMaxSize
.See bellow a small code sample that disturbs me.
Reproduction steps
Expected behavior
I would expect to have the same values for the transformations no matter the order of the elements.
ie
transfo(a).shape == torch.Size([1, 1, 256, 128])
andtransfo(b).shape ==torch.Size([1, 1, 173, 256])
Am I missing something here ?
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: