sniklaus / pytorch-pwc

a reimplementation of PWC-Net in PyTorch that matches the official Caffe version
GNU General Public License v3.0
608 stars 122 forks source link

Is it possible to process bigger image size? #37

Closed kaishijeng closed 4 years ago

kaishijeng commented 4 years ago

Current code has limitation of 1024x436. Can it change to handle large size image, like 1920x1080?

Thanks,

sniklaus commented 4 years ago

What stops you from changing the following lines?

https://github.com/sniklaus/pytorch-pwc/blob/cf0d2f2cbef4bcb0f6cbf09011960a4899d77dec/run.py#L293-L294

kaishijeng commented 4 years ago

OK, I will try these 2 line changes. One more question about backwarp in run.py. I will use the following call, backwarp(tenFirst, tenOutput), in run.py and got errors below:

File "run.py", line 48, in backwarp tenHorizontal = torch.linspace(-1.0, 1.0, tenFlow.shape[3]).view(1, 1, 1, tenFlow.shape[3]).expand(tenFlow.shape[0], -1, tenFlow.shape[2], -1) IndexError: tuple index out of range

Do you know why?

Thanks,

sniklaus commented 4 years ago

You are the first to report such an issue, so I am not sure what the reason for this exception is. Are your images grayscale by chance?

kaishijeng commented 4 years ago

No, my images are color.

sniklaus commented 4 years ago

Do the provided images work?

kaishijeng commented 4 years ago

I got the same error even I use first.png and second.png in images directory.

python run.py --model default --first images/first.png --second images/second.png --out ./out.flo

sniklaus commented 4 years ago

Can you share your run.py with us?

kaishijeng commented 4 years ago

See the attachment of run.py. I just add backwarp function call to the end of your run.py run.zip

sniklaus commented 4 years ago

I see, so you are added code and that code does not work. My apologies, but I unfortunately do not have the time to support such endeavors. I am only providing a reference implementation as is. I am hence closing this issue since you seem to be able to run the code on arbitrary input sizes now, after having commented out the acknowledgement asserts.