Skip to content

This project for re-implement low light image enhancement which is using Zero-DCE model. My implement based on Pytorch implementation of Li-Chonyi and Tensorflow/Keras 2X implementation of TuVoVan.

License

Notifications You must be signed in to change notification settings

dattv/Zero_DCE_TF14

Repository files navigation

Zero DCE

From the Li-Chonyi published paper and Li-Chongyi - author repository, Tuvovan implemented, I tried to learn and re-implement Zero-DCE.

I use Keras library from tensorflow 1.14 to develop this model

Requirements

👍 Ubuntu 18.04

👍 python=3.6

👍 tensorflow 1.14

👍 numpy>=1.16.4

👍 Opencv

👍 skimage

👍 pillow

👍 pyaml

Dataset

  1. Train dataset from Li-Chongyi / Zero-DCE
  2. Test dataset from Li-Chongyi / Zero-DCE

TFrecord

In this project, training data need to be converted to TFrecord format:

There are some Flag from file create_tfrecord.py need to be consideration:

  1. train_directory in line 21 of create_tfrecord.py: it should be where you store raw training data ./data/train_data

  2. output_directory in line 26 of create_tfrecord.py: it's the folder you want to store tfrecord files: ./data/tfrecord

  3. run python3 create_tfrecord.py

Train

Becarefull with the callback function, because I log too many images to tensorboard, so the tensorboard log may very huge, if you do not have large memory hardisk you need to deactive tensorboard callback function.

Need to check the config file in ./config.yaml.

DATA_DIR: ./data/tfrecord
LOG_DIR: ./logs
OUTPUTS: ./outputs
INPUT_HEIGHT: 256
INPUT_WIDTH: 256
N_CHANNEL: 3
SOLVER:
  EPOCHS: 200
  INIT_LR: 0.0001
  MOMENTUM: 0.9
  LR_SCHEDULE: cosine
  OPTIMS: sgd
  TRAINING: True
  REGULARIZATION: 0.0001
  BATCH_SIZE: 48

To train the model run CUDA_VISIBLE_DEVICES=0 python3 train.py

  1. Training log and tensorboard log are stored in ./logs

  2. weight h5 and *.ckpt are stored in ./outputs

Result

Model architecture

Zero-DCE

Conversion history

conversion-history

Compare between lowlight and enhanced images

compare0 compare1 compare2 compare3 compare4 compare5 compare6 compare7 compare8

Future development

  1. ADD QAT (quantization aware training) feature for optimize 8bit Uint8

  2. Update channel first format

About

This project for re-implement low light image enhancement which is using Zero-DCE model. My implement based on Pytorch implementation of Li-Chonyi and Tensorflow/Keras 2X implementation of TuVoVan.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages