Coder Social home page Coder Social logo

jdc08161063 / rescan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xialipku/rescan

0.0 2.0 0.0 22.11 MB

Recurrent Squeeze-and-Excitation Context Aggregation Net for Single Image Deraining

License: MIT License

Python 97.89% Shell 2.11%

rescan's Introduction

RESCAN: Recurrent Squeeze-and-Excitation Context Aggregation Net

Xia Li, Jianlong Wu, Zhouchen Lin, Hong Liu, Hongbin Zha

Key Laboratory of Machine Perception, Shenzhen Graduate School, Peking University
Key Laboratory of Machine Perception (MOE), School of EECS, Peking University
Cooperative Medianet Innovation Center, Shanghai Jiao Tong University
{ethanlee, jlwu1992, zlin, hongliu}@pku.edu.cn, [email protected]

Rain streaks can severely degrade the visibility, which causes many current computer vision algorithms fail to work. So it is necessary to remove the rain from images. We propose a novel deep network architecture based on deep convolutional and recurrent neural networks for single image deraining. As contextual information is very important for rain removal, we first adopt the dilated convolutional neural network to acquire large receptive field. To better fit the rain removal task, we also modify the network. In heavy rain, rain streaks have various directions and shapes, which can be regarded as the accumulation of multiple rain streak layers. We assign different alpha-values to various rain streak layers according to the intensity and transparency by incorporating the squeeze-and-excitation block. Since rain streak layers overlap with each other, it is not easy to remove the rain in one stage. So we further decompose the rain removal into multiple stages. Recurrent neural network is incorporated to preserve the useful information in previous stages and benefit the rain removal in later stages. We conduct extensive experiments on both synthetic and real-world datasets. Our proposed method outperforms the state-of-the-art approaches under all evaluation metrics.

Prerequisite

  • Python>=3.6
  • Pytorch>=3.1.0
  • Opencv>=3.1.0
  • tensorboard-pytorch

Project Structure

  • config: contains all codes
    • cal_ssim.py
    • clean.sh
    • dataset.py
    • main.py
    • model.py
    • settings.py
    • show.py
    • tensorboard.sh
  • explore.sh
  • logdir: holds patches generated in training process
  • models: holds checkpoints
  • showdir: holds images predicted by the model

Best Practices

Hold every experiment in an independent folder, and assign a long name to it. We recommend list the important parameters in the folder name, for example: RESCAN.ConvRNN.Full.d_7.c_24(d: depth, c: channel).

Default Dataset settings

Rain100H: http://www.icst.pku.edu.cn/struct/Projects/joint_rain_removal.html
Rain800: https://drive.google.com/drive/folders/0Bw2e6Q0nQQvGbi1xV1Yxd09rY2s

We concatenate the two images(B and O) together as default inputs. If you want to change this setting, just modify config/dataset.py. Moreover, there should be three folders 'train', 'val', 'test' in the dataset folder. After download the datasets, don't forget to transform the format!

Train, Test and Show

python main.py -a train
python main.py -a test
python show.py

Scripts

  • explore.sh: Show the predicted images in browser
  • config/tensorboard.sh: Open the tensorboard server
  • config/clean.sh: Clear all the training records in the folder

rescan's People

Contributors

lixiazhiguang avatar xialipku avatar

Watchers

James Cloos avatar  avatar

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.