- Nov 23, 2023: Codes, datasets, and pre-trained models will be released!
- Clone our repository
Download our code.
cd SGF
- Make conda environment
conda create -n pytorch111 python=3.7
conda activate pytorch111
- Install dependencies
conda install pytorch=1.11 torchvision cudatoolkit=10.2 -c pytorch
pip install matplotlib scikit-learn scikit-image opencv-python yacs joblib natsort h5py tqdm
pip install einops gdown addict future lmdb numpy pyyaml requests scipy tb-nightly yapf lpips
- Install basicsr
python setup_basicsr.py develop --no_cuda_ext
Download the following datasets (including the edge maps generated by SAM):
LOL-v1 Baidu Disk (code: o42q
), Google Drive
LOL-v2 Baidu Disk (code: g4c1
), Google Drive
SID Baidu Disk (code: 9rlf
), Google Drive
The code for generating edge maps using SAM are avaliable at (https://github.com/guanguanboy/SAM_Mask_Generation).
Training instructions on different datasets are listed as follows.
training code:
./train_sam.sh Enhancement/Options/Enhancement_SGF_Lolv1.yml
training code:
./train_sam.sh Enhancement/Options/Enhancement_SGF_Lolv2_real.yml
training code:
./train_sam.sh Enhancement/Options/Enhancement_SGF_Lolv2_synthetic.yml
training code:
./train_sam.sh Enhancement/Options/Enhancement_SGF_SID.yml
Fisrt download the pretained model from Google Drive or Baidu Disk(code: pacs
)and put them in the root directory.
Evaluation instructions on different datasets are listed as follows.
testing code:
python3 Enhancement/test_from_dataset.py --opt Enhancement/Options/Enhancement_SGF_Lolv1.yml --weights pretrained_models/LOLv1/net_g_latest.pth --dataset LOLv1_edge
testing code:
python3 Enhancement/test_from_dataset.py --opt Enhancement/Options/Enhancement_SGF_Lolv2_real.yml --weights pretrained_models/LOLv2_real/net_g_latest.pth --dataset LOLv2
testing code:
python3 Enhancement/test_from_dataset.py --opt Enhancement/Options/Enhancement_SGF_Lolv2_synthetic.yml --weights pretrained_models/LOLv2_synthetic/net_g_latest.pth --dataset LOLv2_synthetic
testing code:
python3 Enhancement/test_from_dataset.py --opt Enhancement/Options/Enhancement_SGF_SID.yml --weights pretrained_models/SID/net_g_latest.pth --dataset SID_SAM
Experiments are performed for low-light image enhancement or four benchmark dataset.
If you use our code, please consider citing our paper:
Should you have any question, please contact liguanlin1229@gmail.com
Acknowledgment: This code is based on the BasicSR toolbox.