Code Monkey home page Code Monkey logo

raisr's People

Contributors

kvnloo avatar movehand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raisr's Issues

should be equal ==

if nonzerow != 0:

Hi,

thanks for sharing the code. it works great.
one thing that i noticed that the code at the link above should be '==', correct? if the values are complex number, they should be converted to real.

feel free to correct me.
thanks,
jun

The problem of runtime

@movehand
Hello, can I ask you a question about the running speed of the program?
GOOGLE says that the RAISR runtime is about 10^-2 to 10^-1 seconds.
But I test it and the actual running time of a 512*512 medium sized image on the i7 processor was tens of seconds.
Why the difference between the two running time is so huge?

AttributeError: module 'scipy.fftpack' has no attribute 'rfft'

Hi, does anyone know how I can resolve this issue?

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/StephenPereira/raisr/train.py", line 14, in <module>
    from skimage import transform
  File "/usr/local/lib/python3.7/site-packages/skimage/__init__.py", line 167, in <module>
    from .util.dtype import (img_as_float32,
  File "/usr/local/lib/python3.7/site-packages/skimage/util/__init__.py", line 6, in <module>
    from .apply_parallel import apply_parallel
  File "/usr/local/lib/python3.7/site-packages/skimage/util/apply_parallel.py", line 8, in <module>
    import dask.array as da
  File "/usr/local/lib/python3.7/site-packages/dask/array/__init__.py", line 50, in <module>
    from . import random, linalg, overlap, fft
  File "/usr/local/lib/python3.7/site-packages/dask/array/fft.py", line 216, in <module>
    fft = fft_wrap(np.fft.fft)
  File "/usr/local/lib/python3.7/site-packages/dask/array/fft.py", line 142, in fft_wrap
    if fft_func is scipy.fftpack.rfft:
AttributeError: module 'scipy.fftpack' has no attribute 'rfft'

Issue encountered during training!

This one came when I tried to train it:

C:\Users\rahma\Downloads\raisr-master\hashkey.py:40: RuntimeWarning: invalid value encountered in sqrt
sqrtlamda2 = np.sqrt(w[1])

This one came when I finished training:

C:\Users\rahma\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\linalg\linalg.py:2093: RuntimeWarning: overflow encountered in det
r = _umath_linalg.det(a, signature=signature)

This came when I tried to retrain (I tried to train using a RAW file, I think you can't use RAW files):

C:\Users\rahma\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\linalg\linalg.py:2093: RuntimeWarning: overflow encountered in det
r = _umath_linalg.det(a, signature=signature)

Who so slow?

Why is the algorithm super slow? Is it normal?
A minute passed and it is at 16%!

image

Tried to make it GPU optimized

But I failed...
Firstly, I rewrote the code with Cupy rather than Numpy. However some functions used in Raisr, like gradient (maybe we can replace it with other apis available in Cupy? ), have not been realized in Cupy. I also tried to mix Numpy and Cupy. It works, but doesn't perform well. Maybe the exchange of data between GPU and CPU costs too much time.
Then, I tried Numba. Sadly its Cuda function does not support Numpy array methods. Beside, @jit does produce efficient machine code, but the promotion is limited.
To parallelize those loops, maybe we have to rewrite the code. If anyone wants to make Raisr GPU optimized on Python, contact me and we can work together.

In addition, I suggest the author to add the retraining feature by saving Q&V and other parameters. It would be useful and efficent, while eaiser to realize than GPU optimization.

Can you please share your trained filters file?

I used the DIV2K data set as the training set, which contains 800 images, when I was training the model, it took too long to train every single image, about 4 mins/image. So I have to use 20 images instead, but it still took about one and a half hour, so may I ask if you can share your trained filters file please?

And my email is : [email protected] , I would be greatful if you send me the file, thanks.

‘fliter’ file not found

while testing the test.py, it raised an error:

File "test.py", line 27, in <module>
    with open("filter", "rb") as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'filter'

Can't get it running, syntax error

I've tried setting up your project using Python 2.7 (as far as I can tell PIL will not work with Python 3.x) and installed all listed dependencies. When I try running python train.py this error is encountered:

  File "train.py", line 60
    print('\r', end='')
                   ^
SyntaxError: invalid syntax

2x - [width, height] -> [width*2-1, height*2-1]?

Hey, thanks for the great implementation of RAISR!

I wanted to compare it to some other solutions and noticed that the output images are [width2-1, height2-1] instead of 2x (so test.py with a 100x100 image will result in 199x199). I need to read the paper to get a better understanding but is this an expected result?

train error cv2.error

i trained using python3 train.py

all went well until this happened

Processing image 63 of 100 (train/158225.png)               
Processing image 64 of 100 (train/158232.png)               
Processing image 65 of 100 (train/158389.png)               
Processing image 66 of 100 (train/158111.png)               
Processing image 67 of 100 (train/158395.png)               
Processing image 68 of 100 (train/158253.png)               
Processing image 69 of 100 (train/158125.png)               
Processing image 70 of 100 (train/158332.png)               
Processing image 71 of 100 (train/158051.png)               
Processing image 72 of 100 (train/158220.png)               
Processing image 73 of 100 (train/158410.png)               
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 11144
Traceback (most recent call last):
  File "train.py", line 54, in <module>
    grayorigin = cv2.cvtColor(origin, cv2.COLOR_BGR2YCrCb)[:,:,0]
cv2.error: /io/opencv/modules/imgproc/src/color.cpp:11144: error: (-215) scn == 3 || scn == 4 in function cvtColor


kindly advise

My result is no as clear as yours

I putted the same images in the test directory,and ues "python test.py -f filters/filter_BSDS500"to use your pretrained filter,but the results were still not clear.
If there is someting wrong with my steps,please tell me,i would be very grateful!

Resolution issue

Hi, it works pretty well, thank you. However I noticed the final resolution has one row and column less than expected (e.g. 256 in the source will give 511 in the result). It's a problem to measure PSNR and SSIM. Is it possible to fix that? THX

About "filter" file???

Traceback (most recent call last):
File "test.py", line 27, in
with open("filter", "rb") as fp:
IOError: [Errno 2] No such file or directory: 'filter'

How can I retrain a new filter using my own datasets?

Now that the result Q, P matrix can be saved in the project, Is there any researchers retrain a new filter using the pretrained filter training by BSDS datasets to enhancing the quality of your own datasets? If any, what the quality or performance is like? I'd appreciate if there are some suggestion for me.

Won't accept .tif files

The code won't accept files in .tif or .tiff format, but this is a super easy fix. I cloned the repo on my local and just added '.tif', '.tiff' to the list of file extensions on line 43 in train.py and line 39 in test.py and it worked just fine.

About upscale times

Thank you for your works!
I notice for test image,the default upscale time is 2,if I want to change it to 4 times,how can I realize it.
Thank you for your reply.

Training and Retraining?

Can this be trained more than once, for an improved model? Or does it overwrite any previous training and only use new data?

Let's get some more development for this project!

@movehand this is an awesome project! I think that the best way to get it to grow is to add some development guidelines and some docs for other developers to hop on and help build new functionality. I think that sphinx would be a good place to get started so that docs can be created from parsing in-line documentation.

error in training

give me the following:

Processing image 24990 of 24999 (train/5250.png)            
Processing image 24991 of 24999 (train/69661.png)           
Processing image 24992 of 24999 (train/86409.png)           
Processing image 24993 of 24999 (train/49488.png)           
Processing image 24994 of 24999 (train/10603.png)           
Processing image 24995 of 24999 (train/47914.png)           
Processing image 24996 of 24999 (train/93227.png)           
Processing image 24997 of 24999 (train/118034.png)          
Processing image 24998 of 24999 (train/155332.png)          
Processing image 24999 of 24999 (train/79525.png)           
Preprocessing permutation matrices P for nearly-free 8x more learning examples ...
Computing h ...
|/home/hat/.local/lib/python3.5/site-packages/numpy/linalg/linalg.py:1874: RuntimeWarning: overflow encountered in det
  r = _umath_linalg.det(a, signature=signature)
Finished.  

Multithreading support?

Hi there!

The question/suggestion is simple: can you add multithreading support? The script is currently using only one thread (of the 12 on my machine). Can this be done in the scripts them selfs, or is this an issue in Python?

Training Images vs Testing images

Hi, nice and clean implementation, congrats.
I think the readme should explain a little bit more which kind of images to put in /train and /test (are these images the high resolution ones or the low resolution ones?)

Thank you for this!

Why the patchsize can't be Multiples of 10?

Error Code when patchsize=10 :
Q[angle,strength,coherence,pixeltype] += ATA
ValueError: operands could not be broadcast together with shapes (100,100) (121,121) (100,100)

Can't undestand why, anyone could help me ?

Testing occurred "Abort (core dumped)"

I used 20 images to train the model, and want to test my image, but when I executed python test.py, it raised an error:
image

My test image size is 500 x 750, the format is jpg, I put that image to the test document.

Any ideas would be thankful.

Filters used to generate results in README?

Hi,

I wasn't able to obtain the HR results shown in the README with the pretrained filters. Would you mind sharing the filters used to generate these results?

Thank you for starting this amazing project.

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.