Coder Social home page Coder Social logo

deep-hs-prior's Introduction

Deep Hyperspectral Prior: Single Image Denoising, Inpainting, Super-Resolution

image preview

Supplementary code to the paper O Sidorov, JY Hardeberg. Deep Hyperspectral Prior: Denoising, Inpainting, Super-Resolution in ICCV 2019 Workshops.

Get started

The implementation is based on original Deep Image Prior code by Dmitry Ulyanov.

The framework was modified to process hyperspectral data using 2D or 3D convolutions:

image framework

Requirements

  • python = 3.6
  • pytorch = 0.4
  • numpy
  • scipy
  • matplotlib
  • scikit-image
  • jupyter

Prepare the data

  • Input and output hyperspectral data is contained in *.mat files.
  • Specify a path to the file and name of the variable to read.
    For example, if data is contained in variable image:
    file_name  = 'data/inpainting/inpainting192.mat'
    mat = scipy.io.loadmat(file_name)
    img_np = mat["image"]
    
  • Use custom code or one of the *.m files located at data/%task%/ to generate *.mat file.

Run the code

  • Follow one of the proposed notebook files to get the results.
    * 2D versions tend to demonstrate better accuracy.
  • Try to modify parameters. Have fun.


Some results

Denoising:

image noise

Super-Resolution:

image sr

Inpainting:

image_inpainting



Please, kindly cite the paper if you use the code!

deep-hs-prior's People

Contributors

acecreamu 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

deep-hs-prior's Issues

[denoising2D] Error : No such file or directory: 'results/result_denoising_2D_it000

I was trying to run denoising2D file. Downloaded DC dataset, generated .mat file. In the last Block titled "Optimize" I get this error :

FileNotFoundError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/scipy/io/matlab/mio.py in _open_file(file_like, appendmat, mode)
38 try:
---> 39 return open(file_like, mode), True
40 except IOError:

FileNotFoundError: [Errno 2] No such file or directory: 'results/result_denoising_2D_it00000.mat'

During handling of the above exception, another exception occurred:

FileNotFoundError Traceback (most recent call last)
6 frames
/usr/local/lib/python3.7/dist-packages/scipy/io/matlab/mio.py in _open_file(file_like, appendmat, mode)
43 if appendmat and not file_like.endswith('.mat'):
44 file_like += '.mat'
---> 45 return open(file_like, mode), True
46 else:
47 raise IOError('Reader needs file name or open file-like object')

FileNotFoundError: [Errno 2] No such file or directory: 'results/result_denoising_2D_it00000.mat'

Due to this line,
if i % save_every == 0: scipy.io.savemat("results/result_denoising_2D_it%05d.mat" % (i), {'pred':out_np.transpose(1,2,0), 'pred_avg':out_avg_np.transpose(1,2,0)})
What should be done to resolve it?
image

Missing data?

When I try to run "prepare_sr.m" I get an error that says "undefined function or variable pavia". The Matlab code starts without defining it.

the net output shape problem

Dear author,
Thank you so much for your code.
When I running the Optimize part in the "denoising.ipynb", having a problem as below:
RuntimeError: The size of tensor a (192) must match the size of tensor b (200) at non-singleton dimension 3

Then, I find the out size will become [1, 191, 192, 192] when through the "net", could you tell me how to solve this problem? Thank you very much!

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.