Giter VIP home page Giter VIP logo

usrnet's Issues

How to use model?

Hello, could you please add some instruction to how run a demo py code?

decompressing data: inconsistent stream statede

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
请问有遇到过这种问题吗?十分感谢

License?

Hi,
Please specify directly what license covers this project.

details about the D module

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.

How to use the model for unknown images?

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?

Train my own dataset

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

A question about result

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?

Testing/Training scripts.

Hi,

Do you plan to publish the training scripts, testing scripts or the pre-trained model weights for usrnet.

Best regards

test on real image

How are you going to remove artifacts? The test result image is clearer, but the artifacts are also more obvious

main_test_table1.py

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.

By setting the scale factor to 1, USRNet can handle deblurring problem.

我直接将样例中的图像,保存在测试图像文件夹中,仅改变了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?
tiger_x1_usrnet_LE

How to get the deblur result?

I run the demo main_test_realapplication.py and can not get the deblur result like you provided example. My result is like this (seems deblur not work):
image

Out of memory

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?

Training codes ?

hi,
this work looks amazing, do you have a plan to release the training codes?
thank you

No module named 'models.basicblock'

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

blur_kernel

@cszn 你好,我问一下论文代码里的模糊核是已知项还是未知项,看你论文里写的是已知模糊核输入,然后去模糊,这里有点不明白

Problems during training

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!

Training details

@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

text image get a bad results....

Hi,
Thanks for releasing this repo.I test your model with a text image and the results are as follow...
20190808120143_x4_usrnet_LE

I feel confused because your test image chip.png can get a really good results, BUT mine ....
could you give me some advice??

Experimental comparison

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~

Segmentation fault (core dumped)

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
十分感谢

By setting the scale factor to 1, USRNet can handle deblurring problem.

Hello , thank you for your outstanding work. For the deblurring part, I set it as follows and used the tiger image in the instructions, but it did not achieve the desired effect. What is the reason?
test_image = 'tiger.png' # 'chip.png', 'comic.png'
sf = 1 # scale factor, only from {1, 2, 3, 4}
Uploading tiger_x1_usrnet_LE.png…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.