A pytorch implementation of Deep Graph Laplacian Regularization for image denoising. Original work: Zeng et al.
-
Clone this repository
git clone https://github.com/huyvd7/pytorch-deepglr
-
Install required packages listed in requirements.txt (with Python 3.7)
We provide implementations for both DeepGLR and GLR since DeepGLR is a stacking version of GLRs. GLR is a smaller network and can be test more quickly, but it has poorer performance than DeepGLR.
python validate_DGLR.py dataset/sample/ -m model/YOUR_MODEL -w
python validate_GLR.py dataset/sample/ -m model/YOUR_MODEL -w
The above commands resize the input images located at dataset/sample/
to square images with size width x width
, then performs evaluation for the given trained model model/YOUR_MODEL
and saves outputs to current directory.
python train_DGLR.py dataset/sample/ -n MODEL_NAME -d ./ -w width -e epoch -b batch_size -l learning_rate
The above command will train a new DeepGLR. If you want to continue training an existing DeepGLR instead of training from scratch, you can add -m PATH_TO_EXISTED_MODEL
:
python train_DGLR.py dataset/train/ -m model/deepglr.pretrained -n MODEL_NAME -d ./ -w width -e epoch -b batch_size -l learning_rate
python train_GLR.py dataset/train/ -n MODEL_NAME -d ./ -w width -e epoch -b batch_size -l learning_rate
Same parameters as DeepGLR.
python denoise.py dataset/test/noisy/2_n.bmp -m model/deepglr.pretrained -w 324 -o OUTPUT_IMAGE.PNG
The above command will resize the dataset/test/noisy/2_n.bmp
to 324x324
, then denoise it using a trained DeepGLR model/deepglr.pretrained
and save the result at OUTPUT_IMAGE.PNG
.