This project is based on the thesis《Deep Photo Enhancer: Unpaired Learning for Image Enhancement from Photographs with GANs》。
The author's project address is:nothinglo/Deep-Photo-Enhancer
My code is based on hyerania\Deep-Learning-Project
中文文档说明请看这里
- Python 3.6
- CUDA 10.0
- To install requirements:
pip install -r requirements.txt
Expert-C on MIT-Adobe FiveK dataset
- All hyperparameters are in
libs\constant.py
- There are some folders need to be created:
images_LR
:Used to store datasetsExpert-C
input
- In each of the above two folders, the following three new folders need to be created:
Testing
Training1
Training2
models
:Used to store all the training generated files:gt_images
input_images
pretrain_checkpoint
pretrain_images
test_images
train_checkpoint
train_images
train_test_images
- In each of the above folders, the following two new folders need to be created:
1Way
2Way
log
: used to store all logs and the result of data visualizationpretrain
: store all charts of pretraintrain
: store all charts of train
-
If you don't have a pretrain module, the first thing you need to do is running "1WayGAN_PreTrain.py":
python 1WayGAN_PreTrain.py
-
The last generated
\models\pretrain_checkpoint\gan1_pretrain_xxx_xxx.pth
should be placed in the root directory, like "gan1_pretrain_100_113.pth" in my repository. -
Next you need to change the line 15 in “1WayGAN_Train.py” or the same line in “2WayGAN_Train.py”.
-
To train the model, please run this command:
# Only if you want to use 1 way Gan python 1WayGAN_Train.py # Only if you want to use 2 way Gan python 2WayGAN_Train.py
For now, the evaluation and training are simultaneous. So there is no need to run anything.
To evaluate my module, I use PSNR in “XWayGAN_Train.py”
<style type="text/css"> .tg {border-collapse:collapse;border-spacing:0;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:black;} .tg .tg-18eh{font-weight:bold;border-color:#000000;text-align:center;vertical-align:middle} .tg .tg-wp8o{border-color:#000000;text-align:center;vertical-align:top} .tg .tg-xwyw{border-color:#000000;text-align:center;vertical-align:middle} .tg .tg-mqa1{font-weight:bold;border-color:#000000;text-align:center;vertical-align:top} </style>1Way GAN | 2Way GAN | BATCH_SIZE | NUM_EPOCHS_PRETRAIN | NUM_EPOCHS_TRAIN | Discriminator Loss | Generator Loss | PSNR | Time | ||
---|---|---|---|---|---|---|---|---|---|---|
Pretrain | 1 | \ | \ | \ | \ | 3H55M | ||||
2 | \ | \ | \ | \ | 8H45M | |||||
3 | \ | \ | \ | \ | 9H25M | |||||
Train | 1 | √ | 2H45M | |||||||
2 | √ | 5H38M | ||||||||
3 | √ | 4H45M |
- There may be a problem in computing the value of PSNR or not. It needs to be proved.
- The compute functions in
libs\compute.py
are wrong, which cause the discriminator loss cannot converge and the output is awful.
This repo is released under the MIT License
For now, This repo is maintained by Zhiwei Li.
Welcome to join me to maintain it together.