Skip to content

CVPR2021 Learning Multi-Scale Photo Exposure Correction论文的非官方pytorch代码

License

Notifications You must be signed in to change notification settings

LZ-CH/Exposure_Correction-pytorch

Repository files navigation

Exposure_Correction-pytorch

English | 简体中文

This project is the unofficial pytorch reproduction code of the CVPR2021 paper on the field of image illumination correction Learning Multi-Scale Photo Exposure Correction.;

I read this very interesting paper Learning Multi-Scale Photo Exposure Correction. a few days ago. I wanted to modify it based on its source code, but the official code of the paper is implemented by MATLAB. For a pytorch user, it is inevitable that it is a bit awkward. Therefore, I spent some time using the pytorch framework to reproduce this paper. When the Bilateral Guided Upsampling (bgu) upsampling method used in the original MATLAB code is not used, but the simple upsampling method is used to process the prediction results, the recurrence result is psnr: 19.756, ssim: 0.749; if adopted, the recurrence result is psnr: 20.313, SSIM: 0.863; ( Original paper in the same way: psnr: 20.205, ssim: 0.769)

Folder structure

The project folder for this section should be placed in the following structure:

Exposure_Correction-pytorch
├── MultiExposure_dataset
│   ├── testing
│   ├── training
│   └── validation
├── log
├── run-out
├── tools
├── snapshots
│   ├── MSPECnet_woadv.pth # pretrained model

Requirements

  1. Python 3.8.0
  2. Pytorch 1.9.1
  3. numpy 1.21.0

If your cuda version is 11.1, you can also configure the environment directly by:

conda create -n mspec_env python==3.8
conda activate mspec_env
pip install -r requirements.txt

prepare data

  1. First download Training| Validation|Testingfrom the official github repository
  2. Place the dataset in the root directory of the project according to the folder result
  3. Run the following code to preprocess the data, and then a new Patchs folder will be generated in the ./MultiExposure_dataset/training directory
python ./tools/creat_patch.py

train

  1. Run the following command for training without adversarial loss:
python mspec_train.py
  1. If you want to add an adversarial loss to training, run:
python mspec_train.py --use_advloss

test

  1. You can directly download the checkpoint that I trained without adversarial loss: baidu clound password: 1234 or unzip snapshots.zip
  2. You can also train the model yourself
  3. Then run the following command for test verification:
python mspec_test.py

bgu

In the testing phase, if you need to use bgu upsampling to replace the default interpolation resize in mspec_test, you need to run the run_bgu.m code for subsequent upsampling.

Contact information

E-mail: 2443976970@qq.com

About

CVPR2021 Learning Multi-Scale Photo Exposure Correction论文的非官方pytorch代码

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published