python execute/infer_full.py -r checkpoint/full.pth --data_dir <path_to_input_data> --result_dir <path_to_result_data> default
Since the file format we use is .npy, we provide scrips for visualization:
- use
scripts/visualize_polarized_img.pyto visualize the polarized hazy images - use
scripts/visualize_img.pyto visualize the unpolarized hazy images and synthetic results - use
scripts/visualize_real_img.pyto visualize real results
Note that in our code implementation, the network input contains three components: {I_alpha, I_hat, delta_I_hat}:
I_alpha: three polarized hazy imagesI_hat: the calculated unpolarized hazy imagedelta_I_hat: the calculated unpolarized hazy image multiplied by the degree of polarization
So, we should preprocess the data first to get the network input:
-
for synthetic images (training and inference)
- use
scripts/preprocess_cityscapes.pyto preprocess the Cityscapes Dataset (require leftImg8bit, gtFine, and leftImg8bit_transmittanceDBF) for generating{image, depth, segmentation}(or choose other source dataset if you want) - use
scripts/make_dataset.pyto generate the synthetic dataset from{image, depth, segmentation}
- use
-
for real images (inference only)
- use
scripts/make_real_dataset_from_raw_format.pyto generate the real dataset from images (in.rawformat) captured by a polarization camera (Lucid Vision Phoenix polarization camera (RGB) in our paper)
- use
-
python sam.py python execute/train.py -c config/subnetwork1.json
- All config files (
config/*.json) and the learning rate schedule function (MultiplicativeLR) atget_lr_lambdainutils/util.pycould be edited