Coder Social home page Coder Social logo

retinexnet's Introduction

RetinexNet

This is a Tensorflow implement of RetinexNet

Deep Retinex Decomposition for Low-Light Enhancement. In BMVC'18 (Oral Presentation)
Chen Wei*, Wenjing Wang*, Wenhan Yang, Jiaying Liu. (* indicates equal contributions)

Paper, Project Page & Dataset

Requirements

  1. Python
  2. Tensorflow >= 1.5.0
  3. numpy, PIL

Testing Usage

To quickly test your own images with our model, you can just run through

python main.py 
    --use_gpu=1 \                           # use gpu or not
    --gpu_idx=0 \
    --gpu_mem=0.5 \                         # gpu memory usage
    --phase=test \
    --test_dir=/path/to/your/test/dir/ \
    --save_dir=/path/to/save/results/ \
    --decom=0                               # save only enhanced results or together with decomposition results

Or you can just see some demo cases by

python main.py --phase=test

, the results will be saved under ./test_results/.

Training Usage

First, download training data set from our project page. Save training pairs of our LOL dataset under ./data/our485/, and synthetic pairs under ./data/syn/. Then, just run

python main.py
    --use_gpu=1 \                           # use gpu or not
    --gpu_idx=0 \
    --gpu_mem=0.5 \                         # gpu memory usage
    --phase=train \
    --epoch=100 \                           # number of training epoches
    --batch_size=16 \
    --patch_size=48 \                       # size of training patches
    --start_lr=0.001 \                      # initial learning rate for adm
    --eval_every_epoch=20 \                 # evaluate and save checkpoints for every # epoches
    --checkpoint_dir=./checkpoint           # if it is not existed, automatically make dirs
    --sample_dir=./sample                   # dir for saving evaluation results during training

Tips:

  1. The model is quite small, so it will take just minutes to finish the training procedure if you are using GPU. For people who are using CPU, it is also affordable.
  2. The enhancement performance is highly dependent on training parameters. So if you change the default parameters, you might get some weird results.

Citation

@inproceedings{Chen2018Retinex,
 title={Deep Retinex Decomposition for Low-Light Enhancement},
 author={Chen Wei, Wenjing Wang, Wenhan Yang, Jiaying Liu},
 booktitle={British Machine Vision Conference},
 year={2018},
 organization={British Machine Vision Association}
}

retinexnet's People

Contributors

weichen582 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

retinexnet's Issues

Supplementary material is not available

Thanks for your job!
As the title says, however, i cannot download the supplmentary material in your project page anymore.
Could you update it or realease a new link?

Use of reduce_max in input

In the beginning of DeconNet function, there are these two ines:

input_max = tf.reduce_max(input_im, axis=3, keepdims=True)
input_im = concat([input_max, input_im])

Could you tell what it does and what is the use of the same?

error in LOLdataset

there are several mistakes on the correspondance in "our485", like the 79.png, 735.png.

Nice for sharing, howerver, Poor performance even using images in data/eval

感谢分享,
但是,
CPU模式下,对data/eval /test下结果也不好,噪点非常明显

python3.6 main.py --use_gpu=0 --phase=test --test_dir=/home//下载/RetinexNet-master/test1/ --save_dir=/home//下载/RetinexNet-master/res1/ --decom=1
是还有其他参数吗?
而且decom参数貌似没用啊

训练Decomposition模型时出现的问题

  1. 训练时LOSS值一直稳定不变,应该和learning_rate没什么关系,无论怎么调整都不会变。
  2. Decomposition模型输出的R_low和I_low会随着训练次数的增加逐渐变白,最后变成全白色。
    这两个是什么原因?我是单独训练Decomposition,应该和这个没关系吧。

version of python

It shows up some errors when I ran the code. The error is "Process finished with exit code -1073741819 (0xC0000005)". I don't think the version of the python I used is right. Could you please tell me the version of yours? Thanks.

diffMAE

Dear author, hello. I recently read your paper "diffmae" and found it very interesting. Can you make your code publicly available?

Too many compile error

my pytorch version is 1.1.0

  1. in dataset.py
    Line 51: class TheDataset(data.dataset):
    class TheDataset(data.dataset): TypeError: module() takes at most 2 arguments (3 given)
    I solve it by changing to:class TheDataset(data.Dataset)

2.in train.py
Line 64: dataloader = torch.utils.data.dataLoader(train_set, batch_size=args.batch_size...)
dataloader = torch.utils.data.dataLoader(train_set, batch_size=args.batch_size, shuffle=True, AttributeError: module 'torch.utils.data' has no attribute 'dataLoader'
I solve it by changing to:dataloader = torch.utils.data.DataLoader(train_set, batch_size=args.batch_size...)

About the synthetic dataset

I noticed that there are some deformations in the synthetic image pairs (384×384) provided by your project page. Maybe you did some operations like resize? Do they have any impacts on your results?
By the way, in your paper, you said that these raw images are resized to 400×600. Why are they 384×384 currently?

License

Hi. I used the library and it works great! Could you please add a license to the repository?

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.