HuangxingLin123 / Noise2Grad_Pytorch_code

13 stars 1 forks source link

Noise2Grad_Pytorch_code

Pytorch implementation for "Noise2Grad: Extract Image Noise to Denoise" (IJCAI-2021)

Paper Link: Link

Training

Download the training datasets from Google Drive. Unzip "ground_truth.zip" and "reference_clean_image.zip" and put them in "./datasets/train/". Use the code 'matlab_code_for_synthesizing_gaussian_noise.m' or 'matlab_code_for_synthesizing_speckle_noise.m' or 'python_code_for_synthesizing_poisson_noise.py' to synthesize noisy images, and then put them into "./datasets/train/noisy_train/".

python train.py --dataroot ./datasets/train/noisy_train/ --name new --model denoise

Testing

Download the testing dataset from Google Drive.

Unzip "ground_truth.zip" in './datasets/test/'. Use the code 'matlab_code_for_synthesizing_gaussian_noise.m' or 'matlab_code_for_synthesizing_speckle_noise.m' or 'python_code_for_synthesizing_poisson_noise.py' to synthesize noisy images, and then put them into "./datasets/test/noisy_test/".

python test.py --dataroot ./datasets/test/noisy_test/ --name new --model denoise

gaussian pretrained

python test.py --dataroot ./datasets/test/noisy_test/ --name gaussian_pretrained --model denoise

poisson pretrained

python test.py --dataroot ./datasets/test/noisy_test/ --name poisson_pretrained --model denoise

speckle pretrained

python test.py --dataroot ./datasets/test/noisy_test/ --name speckle_pretrained --model denoise

After the test, results are saved in './results/'.

Run "psnr_and_ssim.py" to caculate psnr and ssim.