Skip to content
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

Not applicable for odd-sized images #7

Open
LujiaJin opened this issue Jul 1, 2022 · 0 comments · May be fixed by #8
Open

Not applicable for odd-sized images #7

LujiaJin opened this issue Jul 1, 2022 · 0 comments · May be fixed by #8

Comments

@LujiaJin
Copy link

LujiaJin commented Jul 1, 2022

The current version of the code defaults to uniformly cropping input images during training and testing. In practice, when testing, we often don't want to do too many operations on the image, including cropping.
Without cropping the image, an unforeseen problem arose. nn.Conv2d cuts off edges by default for odd-sized images to make them even in size, which facilitates the flow of feature maps in the network. However, for U-Net, this results in inconsistent image sizes before and after skip concatenation, which will eventually result in an error.
A possible solution is to trim the edges of odd-sized images in the data provider during testing, so as to preprocess their sizes into even-numbered ones.
This solution idea has almost no effect on the functionality of the original method. Just dropping one or two edges of the image does not affect the evaluation of the model's denoising performance. At the same time, since the size of most images is even, only performing additional trimming operations for a few odd-sized images hardly adds additional time consumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant