We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi Alister,
I ran into the following issue with subpixel cropping.
The output shape of subpixel_crop_2d is not square. This should highlight and reproduce the issue:
import torch import einops from torch_subpixel_crop import subpixel_crop_2d x = torch.zeros((35, 465, 480)) center = torch.tensor([232,240]) center = einops.repeat(center, "yx -> b yx", b=len(x)) print(subpixel_crop_2d(x, positions=center, sidelength=465).shape) >>> torch.Size([35, 465, 464])
while the expected shape is (35, 465, 465).
Perhaps a problem with uneven dimensions?
The text was updated successfully, but these errors were encountered:
Huh, thanks for the report! Yes I would assume this is the odd box size...
I'm actually not sure there is a good way to be consistent with FFTs of odd dimensions, do you think it's worth trying to support?
At a minimum we should explicitly disallow odd dims it if we don't support it
Sorry, something went wrong.
The way it can be done is to use the s (shape) argument of irfftn. That way you can ask it to return the original shape.
s
So you think this issue originates from the fourier_shift_image_2d() function?
For sure!
BTW, the shape I started with (35, 465, 480) was output from fourier_rescale.
(35, 465, 480)
No branches or pull requests
Hi Alister,
I ran into the following issue with subpixel cropping.
Versions
Description
The output shape of subpixel_crop_2d is not square. This should highlight and reproduce the issue:
while the expected shape is (35, 465, 465).
Perhaps a problem with uneven dimensions?
The text was updated successfully, but these errors were encountered: