minhmanho / dpscan

[WACV'22] Deep Photo Scan: Semi-Supervised Learning for dealing with the real-world degradation in Smartphone Photo Scanning
https://minhmanho.github.io/dpscan/
23 stars 4 forks source link

Didn't work with real world images when tested #1

Closed ofirkris closed 3 years ago

ofirkris commented 3 years ago

Hi, thanks for sharing this amazing project, i've tried to run inference on the attached image + on some old photos and got the following issues:

Traceback (most recent call last): File "run.py", line 26, in dpscan(img_dir, out_path) File "/root/filters/dpscan/dpscan.py", line 23, in call tensor_out = self.G(tensor_img) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, kwargs) File "/root/filters/dpscan/networks/networks.py", line 50, in forward X = self.layer_1(X) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, *kwargs) File "/root/filters/dpscan/networks/components.py", line 76, in forward return self.layers(X) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(input, kwargs) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/container.py", line 117, in forward input = module(input) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 423, in forward return self._conv_forward(input, self.weight) File "/root/anaconda/envs/ai/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 420, in _conv_forward self.padding, self.dilation, self.groups) RuntimeError: Given groups=1, weight of size [32, 3, 5, 5], expected input[1, 4, 720, 1072] to have 3 channels, but got 4 channels instead png-ww-test

Can you add support for images with more channels? can you support jpg too?

minhmanho commented 3 years ago

Hi,

Thank you for being interested in my project.

Project doesn't work with JPG, JPEG input images, it just skips these files

Yes, I set it to read images from the dataset in PNG only. I will set it to read varied formats later.

Got the following error when trying to run inference on the attached image

Your PNG image contains 4 channels of RGB"A" including the transparency information.

Can you add support for images with more channels? can you support jpg too?

Sure, I will fix it within 24 hours.

By the way, you can roughly fix it yourself by: