Two implementation for exposure adjustment:
- CLAHE (
./exposure/CLAHE/clahe.py) - ECM model (
./exposure/ECM/ECM)
To execute the CLAHE, open your terminal and run:
python clahe.pyRemember to change the data path in the script before execution!
To test the ECM, open your terminal and run:
python test.py --ntest 1000 --results_dir "dataset/ECM_output" --checkpoints_dir checkpoints --name exposure_correction_experiment --loadSize 640 --fineSize 640 --dataroot "dataset" --dir_A input --no_flip --label_nc 3 --how_many 1000 --phase_test_type test_all --which_epoch 100 --netG global --ngf 64 --n_downsample_global 4 --n_blocks_global 9 --batchSize 1To evaluate the ECM output, run:
python evaluate_new.py --images_path1 dataset/ground_truth --images_path2 dataset/ECM_output/exposure_correction_experiment/test_100/images --metric SSIMHere is how we finetune the pretrained model with our own images in dataset/train:
python train.py \
--isTrain True \
--continue_train True \
--name exposure_correction_experiment \
--checkpoints_dir checkpoints \
--which_epoch 100 \
--dataroot "my data path" \
--dir_A train \
--dir_B ground_truth \
--loadSize 640 \
--fineSize 640 \
--nThreads 0 \
--gpu_ids 0 \
--batchSize 1 \
--niter 50 \
--l1_image_loss True \
--perceptual_loss True \
--label_nc 3 \
--output_nc 3 \
--netG global \
--ngf 64 \
--n_downsample_global 4 \There is also a ECM/ECM/README.md from the ECM github repo I cite, with the link to download the pretrained model I used.
This repository contains two implementations for image deblurring:
- Wiener Filter baseline (
./deblur/wiener/wiener.py) - MPRNet deep learning model (
./deblur/mprnet/demo_cpu.py)
Both scripts can be run directly.
Train the MPR-Net model with default arguments by running
python train.py
To evaluate the SSIM for both methods:
- Wiener Filter baseline (
./deblur/wiener/eval.py) - MPRNet deep learning model (
./deblur/mprnet/samples/eval.py)
Both scripts can be run directly.