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

Modify Output field of expression #89

Open
ha-daiy opened this issue Sep 21, 2022 · 3 comments
Open

Modify Output field of expression #89

ha-daiy opened this issue Sep 21, 2022 · 3 comments
Labels
good first issue Good for newcomers

Comments

@ha-daiy
Copy link

ha-daiy commented Sep 21, 2022

Hi,
According to this link"#8", it is stated: "You rfield and efield values (and spcscale if your net does change the physical spacing of the output) must be consistent with the model that you want to run." I am wiling to know how to change the Output field of expression which is currently [512,512] to a bigger one?(I am using the model in fully convolution mode). Right now, by using [512,512] the output is smaller than the input image(I think it will crop the input image to 512*512 pixels so some locations/pixels will not present in the output. Accordingly, to not lose those pixels I want to know if there is any rule(s) to learn to modify the Modify Output field of expression?
PS: my O.S is Ubuntu 20.04 and I am using the docker version with the CPU.
Thanks for your time.

@remicres
Copy link
Owner

Hi @ha-daiy

If your goal is just to process larger chunks of output image, you can adjust the optim.tilesizex and optim.tilesizey. Default value is set to the expression field. Keep in mind that the tile size will be rounded to the nearest lower multiple of the expression field.

If your goal is to modify the expression field of the network, you have to do that inside the network, or build another network that reuses the original network and crop differently the output.
The rule is that the receptive field (RF), expression field (EF), and scale factor (SF), must be consistent together.
For instance if you have a network that decimates the resolution of the input by a factor F, and crop 2 * N pixels from the the outputs (N pixels are removed from each side), then you should have some relation like RF / F - 2 * N = EF

@remicres remicres added the good first issue Good for newcomers label Sep 21, 2022
@ha-daiy
Copy link
Author

ha-daiy commented Oct 1, 2022

Hi,
Thanks for your answer. Would you please explain more about this part: "Keep in mind that the tile size will be rounded to the nearest lower multiple of the expression field.". I did not get it well(my understanding is that I cannot change "optim.tilesizex" and/or "optim.tilesizey" to any desired float(number)---> is it correct? If so, what is the upper limit for each one?) so any more explanation would help.
Thanks

@ha-daiy
Copy link
Author

ha-daiy commented Oct 2, 2022

In addition, based on my experiments, there is a flag called --pad in which you set the desired value to remove pixels from the input image(the available range to choose is [32, 64, 128, 256, 512]). For my use case, I do not want to remove any pixels from the input image( I want to feed the input image to the sr4rs model and receive the super resolution version of the whole input image). I tried to set --pad 0 but, as mentioned, this is not possible in the available range. So, do you have any idea to handle this problem?(specially using the pretrained sr4rs model not retraining a new one or using transfer learning.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants