This repository is the official MIPI Challenge 2023 implementation of Team LVGroup_HFUT in Nighttime Flare Removal.
The restoration results (Extraction Code:a9zs) of the tesing images and pretrained model (Extraction Code:l9zt) can be downloaded from Baidu Netdisk.
cd your/script/path
python infer.py --data_source your/dataset/path --model_path ../pretrained/epoch_0090.pth --save_image --experiment your-experiment-name
cd your/script/path
python train.py --data_source your/dataset/path --experiment your-experiment
The format of the dataset should meet the following code in datasets.py:
self.img_paths = sorted(glob.glob(data_source + '/train' + '/Flare' + '/*.*'))
self.gt_paths = sorted(glob.glob(data_source + '/train' + '/Flickr24K' + '/*.*'))
or
self.img_paths = sorted(glob.glob(data_source + '/val' + '/input' + '/*.*'))
data_source is given by the command line.
mode can be 'train' or 'val'.
when training and validating: the default path is '../results/your-experiment'
when testing: the default path is '../outputs/your-experiment/test'
when inferring: the default path is '../outputs/your-experiment/infer'