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 paper The official code of MATLAB 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)
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
- Python 3.8.0
- Pytorch 1.9.1
- 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
- First download Training| Validation|Testingfrom the official github repository
- Place the dataset in the root directory of the project according to the folder result
- 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
- Run the following command for training without adversarial loss:
python mspec_train.py
- If you want to add an adversarial loss to training, run:
python mspec_train.py --use_advloss
- You can directly download the checkpoint that I trained without adversarial loss: baidu clound password: 1234 or unzip snapshots.zip
- You can also train the model yourself
- Then run the following command for test verification:
python mspec_test.py
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.
E-mail: [email protected]