Giter Site home page Giter Site logo

icbcbicc / pytorch_epll Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 0.0 13.06 MB

PyTorch implementation of Expected Patch Log Likelihood (EPLL) image prior in paper "D. Zoran and Y. Weiss, "From learning models of natural image patches to whole image restoration," ICCV 2011.

License: MIT License

Python 100.00%
image-processing imagedenoise denoising gaussian-mixture-models imageprior pytorch

pytorch_epll's Introduction

PyTorch implementation of Expected Patch Log Likelihood (EPLL) image prior

1. Paper:

The EPLL image prior model is presented in "D. Zoran and Y. Weiss, "From learning models of natural image patches to whole image restoration," 2011 International Conference on Computer Vision, Barcelona, 2011, pp. 479-486, doi: 10.1109/ICCV.2011.6126278."

2. Acknowledgement:

This code is based on the original Matlab implementation, authored by Yair Weiss. The pre-trained GMM model is also borrowed from the original code.

3. Key features:

  • Pure PyTorch implementation
  • Support color image
  • Support batch mode (input.shape=[B, C, H, W])
  • Adjustable stride: --stride n (default 4, the stride in the original matlab code is fixed to 1, higher stride will speed up the code and reduce RAM usage)
  • Support parallel processing: --parallel True (default True, requires more RAM)

4. Requirements:

  • torch-scatter, tested with version 2.0.5
  • Tested with pytorch 1.6.0 and cuda 10.2 on Ubuntu 18.04

5. Usage:

Denoising a clean grayscale image 160068.jpg contaminated by gaussian noise of standard deviation 0.1:

python epll_demo.py --im_file 160068.jpg --noise_std 0.1

  • Specifying --stride n will speed up the code and reduce RAM usage.
  • Specifying --parallel True will speed up the code but this requires more RAM.
  • Specifying --use_cuda True will let you use GPU. However, this may consume a lot of GPU RAM.

6. Results:

160068.jpg

result

new.jpg

result

7. TODO:

  • Support color image
  • Support batch processing
  • Optimize speed
  • Support backpropagation

pytorch_epll's People

Contributors

icbcbicc avatar

Stargazers

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

Watchers

 avatar

pytorch_epll's Issues

Training guide

Hi,
Thanks for your great work! I was wondering if you could provide a training guide. Thank you!

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.