Please clone this repo and run following command locally for install the environment:
conda create --name ddom pip install -r requirements.txt
Please put the training dataset into datasets/
folder and test dataset into exp/datasets/
. The restoration results will be saved in exp/image_samples/
. Datasets can be downloaded at link1 and link2.
We have prepared training and testing scripts for various image restoration tasks in the exp.sh
file. For example, if we want to train DDOM for SR, we can run below command:
CUDA_VISIBLE_DEVICES=0 python train.py --A_type adapter --epochs 100 --nums_rb 20 --add_temb True --res_adap True \ --lr 1e-5 --ni --config celeba_hq.yml --path_y celeba_hq --eta 0.85 --batch_size 2 --init_x Apy \ --deg "sr_averagepooling" --deg_scale 4 --sigma_y 0. -i main_sr4 --train_size 2 \ --save save/main_sr4where
nums_rb
is the number of layers in DO-Adapter, deg
is degradation task, config
is the name of the config file (see configs/
folder), path_y
is the path of test images (please save in exp/datasets/
).
This implementation is extended based on DDNM, thanks!