cszn / usrnet Goto Github PK
View Code? Open in Web Editor NEWDeep Unfolding Network for Image Super-Resolution (CVPR, 2020) (PyTorch)
Home Page: https://cszn.github.io/
Deep Unfolding Network for Image Super-Resolution (CVPR, 2020) (PyTorch)
Home Page: https://cszn.github.io/
Hello, could you please add some instruction to how run a demo py code?
Hello, I'm in Python main_ test_ Table1.py encountered
Traceback (most recent call last):
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/hdf5storage/init.py", line 1768, in loadmat
with h5py.File(filename, mode='r') as f:
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 78, in h5py.h5f.open
OSError: Unable to open file (File signature not found)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main_test_table1.py", line 230, in
main()
File "main_test_table1.py", line 87, in main
kernels = hdf5storage.loadmat(os.path.join('kernels', 'kernels_12.mat'))['kernels']
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/hdf5storage/init.py", line 1801, in loadmat
**keywords)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 208, in loadmat
matfile_dict = MR.get_variables(variable_names)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio5.py", line 272, in get_variables
hdr, next_position = self.read_var_header()
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio5.py", line 226, in read_var_header
mdtype, byte_count = self._matrix_reader.read_full_tag()
File "mio5_utils.pyx", line 548, in scipy.io.matlab.mio5_utils.VarReader5.read_full_tag
File "mio5_utils.pyx", line 556, in scipy.io.matlab.mio5_utils.VarReader5.cread_full_tag
File "streams.pyx", line 171, in scipy.io.matlab.streams.ZlibInputStream.read_into
File "streams.pyx", line 158, in scipy.io.matlab.streams.ZlibInputStream._fill_buffer
zlib.error: Error -2 while decompressing data: inconsistent stream state
My environment:
h5py 2.7.0
hdf5storage 0.1.15
torch 1.6.0+cu92
torchvision 0.7.0+cu92
Have you ever encounterd such a problem? Thank you very much.
您好,我在python main_test_table1.py 遇到
Traceback (most recent call last):
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/hdf5storage/init.py", line 1768, in loadmat
with h5py.File(filename, mode='r') as f:
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 271, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/h5py/_hl/files.py", line 101, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 78, in h5py.h5f.open
OSError: Unable to open file (File signature not found)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main_test_table1.py", line 230, in
main()
File "main_test_table1.py", line 87, in main
kernels = hdf5storage.loadmat(os.path.join('kernels', 'kernels_12.mat'))['kernels']
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/hdf5storage/init.py", line 1801, in loadmat
**keywords)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio.py", line 208, in loadmat
matfile_dict = MR.get_variables(variable_names)
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio5.py", line 272, in get_variables
hdr, next_position = self.read_var_header()
File "/root/userfolder/anaconda3/lib/python3.6/site-packages/scipy/io/matlab/mio5.py", line 226, in read_var_header
mdtype, byte_count = self._matrix_reader.read_full_tag()
File "mio5_utils.pyx", line 548, in scipy.io.matlab.mio5_utils.VarReader5.read_full_tag
File "mio5_utils.pyx", line 556, in scipy.io.matlab.mio5_utils.VarReader5.cread_full_tag
File "streams.pyx", line 171, in scipy.io.matlab.streams.ZlibInputStream.read_into
File "streams.pyx", line 158, in scipy.io.matlab.streams.ZlibInputStream._fill_buffer
zlib.error: Error -2 while decompressing data: inconsistent stream state
我的环境
h5py 2.7.0
hdf5storage 0.1.15
torch 1.6.0+cu92
torchvision 0.7.0+cu92
请问有遇到过这种问题吗?十分感谢
Hi,
Please specify directly what license covers this project.
Hi cszn, thanks for this fantastic paper. I think the difference between this paper and DPSR is that H module and D module, but after reading I still don't know the details of D module.
Would you release the traing code in the future? If not, could you elaborate on the implementation of the D module? Thanks in advance.
Accroding to your descriptions and codes, the model need noise level and blur kernel as inputs. But we don't know these two params for an unknown images. So how can we use it for real applications?
Hi, I want to train my own dataset with your code, but my high resolution images are out of proportion to the low resolution, how do I solve this problem? Thanks
Could you please help to convert the pth models to onnx models?
Thanks
thank you for your nice work, when i run your test process, i get some blue images, pytorch version:1.8.0,could you give me some suggestions?
Hi,
Do you plan to publish the training scripts, testing scripts or the pre-trained model weights for usrnet.
Best regards
How are you going to remove artifacts? The test result image is clearer, but the artifacts are also more obvious
Hi, when I run main_test_table1.py
, I get following error: FileNotFoundError: [Errno 2] No such file or directory: 'model_zoo/usrnet.pth'
So, I looked inside model_zoo
folder, but I could not find usrnet.pth.
我直接将样例中的图像,保存在测试图像文件夹中,仅改变了main_test_realapplication.py中改变参数,sf=1和test_image的名称,但是得到了糟糕的结果!请问一些是还有参数需要设置吗?
I directly saved the image in the sample in the test image folder, only changed the parameters in main_test_realapplication.py, sf=1 and the name of test_image, but got bad results! Are there some parameters that need to be set?
It's a great job! I wonder to know how to get pictures with different blur kernels?
First of all, please add requirements.txt to all of your python code, because I don't know what version of libs do you using and need spend 2 hours install different versions of modules to find one working solution, this is bad for developers.
Second, I can't test 1080p images because app is crashing with out of CUDA memory error!
And finally, thanks for amazing job.
Can I contact you directly via email or other messanger?
hi,
this work looks amazing, do you have a plan to release the training codes?
thank you
plz share them, thanks
I just downloaded the ZIP master, unzipped and tried to run main_test_realapplication.py but nothing happens except this error. I checked and there is no such .ph file in "model_zoo"
Hi,
I'm getting some error
File "main_test_realapplication.py", line 19, in
from models.network_usrnet import USRNet as net
File "/content/USRNet/models/network_usrnet.py", line 3, in
import models.basicblock as B
ModuleNotFoundError: No module named 'models.basicblock'
I think file basicblock.py is missing which should be located at models folder
@cszn 你好,我问一下论文代码里的模糊核是已知项还是未知项,看你论文里写的是已知模糊核输入,然后去模糊,这里有点不明白
Hi, I am trying to write a training code based on the training code of DnCNN. I modified JSON file so that "in_nc": 4 , "out_nc": 3
But I still got an error saying that
File "C:\Users\Daizo_\Documents\GitHub\KAIR\models\network_usrnet.py", line 357, in forward
x = self.p(torch.cat((x, ab[:, i+self.n:i+self.n+1, ...].repeat(1, 1, x.size(2), x.size(3))), dim=1))
RuntimeError: Given groups=1, weight of size [64, 4, 3, 3], expected input[1, 2, 40, 40] to have 4 channels, but got 2 channels instead
If I change JSON to "in_nc": 2 , "out_nc": 1 then there wont be this issue, but during testing I still get similar runtime error.
I am not sure how to train the model, could you please publish a training code that working?
Thanks a lot!
otf = torch.rfft(otf, 2, onesided=False)
is compatible with torch 1.8.1
@cszn Hi,This is a very interesting work!!👍
Thank you so much for sharing your code ;)
At present, I can successfully run the training code by reference the code of KAIR and test_usrnet and dpsr.
But when I train, I only use one blur kernel and only considers scale factor 1.
I also use DIV2K800 as the training set, and set H_size to 48, batch_size to 32, and other parameters are basically the same as dpsr.
Currently I have run 400 epochs and the number of iterations is 10000,
But the test result at BSD68 PSNR is only 22 ( scale factor is 1, use same blur kernel).
I want to consult could you provide more training details, such as the number of training iterations, whether to use 12 convolution kernels to join the training together, etc...
In addition, I would like to consult if you have tried not to use H_net to generate parameters, but to manually set them. If so, what range is better ? (I am currently trying this approach)
Look forward to your reply :D
After reading the paper and the code, the kernel is a input, and it won't be updated when training, so this means the kernel directly affects the final result?
Thanks for your nice work!
I am a beginner in blind sr, so I don't understand why you choose the non-blind method RCAN for comparison under the bicubic downsampling setting?
Looking forward to your reply~
I got this error while run main_test_realapplication.py program. The running environment is pytorch 1.8.
May I ask how to deal with this problem?
Hello, Segmentation fault (core dumped) when I'm running main_ test_ table1.py
My environment:
torch 1.3.1
torchvision 0.4.2
Thank you very much.
您好,我在运行main_test_table1.py时出现Segmentation fault (core dumped)
我的环境:
torch 1.3.1
torchvision 0.4.2
十分感谢
AttributeError: 'DatasetUSRNet' object has no attribute 'sf'
there are somebody meet and solve this problem?
could you help me out?
thank you all very much!!
Hello cszn,
Where is the license?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.