If you have any quesions, feel free to contact me. My E-mail and WeChat can be found at my homepage: [Homepage]
Download nighttime haze dataset from websites or papers. Follow the organization form below.
├── dataset_name
├── train
├── hazy
├── im1.jpg
├── im2.jpg
└── ...
├── clear
├── im1.jpg
├── im2.jpg
└── ...
├── val
├── hazy
├── im1.jpg
├── im2.jpg
└── ...
├── clear
├── im1.jpg
├── im2.jpg
└── ...
├── test
├── hazy
├── im1.jpg
├── im2.jpg
└── ...
├── clear
├── im1.jpg
├── im2.jpg
└── ...
The datasets can be downloaded at
Follow step 1 to put the synthetic data into the corresponding folder.
cd task_SFSNiD
python train_SFSNiD_supervised.py --results_dir ../results/MyNightDehazing/train_SFSNiD_supervised/NHR/ \
--img_h 256 --img_w 256 --train_batch_size 4 \
--dataset NHR --total_epoches 100 --lr 0.0001 \
--device cuda:0 --num_res 3
Reduce the brightness of UNREAL-NH's hazy and haze-free images through Gamma correction. We call this dataset UNREAL_NH_No_Sky_Dark. Then proceed to supervised training. The pseudo labels are generated by
cd task_SFSNiD
python Generate_PseudoLabel.py --net SFSNiD \
--results_dir ../results/MyNightDehazing/RWNHC_MM23_pseudo_labels/ \
--img_h 256 --img_w 256 \
--pth_path ../results/MyNightDehazing/train_SFSNiD_supervised/UNREAL_NH_NoSKy_Dark/models/last_SFSNiD_UNREAL_NH_NoSky_Dark.pth \
--dataset RWNHC_MM23
Follow the Step 1. to put the synthetic data and real-world data (pseudo labels) into the corresponding folders.
python train_SFSNiD_semi_supervised.py --results_dir ../results/MyNightDehazing/train_SFSNiD_semi_supervised/RWNHC_MM23_PseudoLabel_kappa130/ \
--img_h 256 --img_w 256 --train_batch_size 4 --dataset RWNHC_MM23_PseudoLabel \
--total_epoches 20 --lr 0.0001 --device cuda:0 --num_res 3 \
--patch_size 16 --bri_ratio 100 --bri_weight 20 --kappa 130
cd task_SFSNiD
python inference_real_world.py --net SFSNiD \
--results_dir ../results/MyNightDehazing/RWNHC_MM23_PseudoLabel_kappa130_results/ \
--img_h 256 --img_w 256 \
--pth_path ../results/MyNightDehazing/train_SFSNiD_semi_supervised/RWNHC_MM23_PseudoLabel_kappa130/models/last_SFSNiD_/RWNHC_MM23_PseudoLabel.pth \
--dataset RWNHC_MM23