Note: This repository has been forked from the original minyuanye/SIUN. The dependencies have been updated to be compatible with Python 3.12. These updates were almost entirely vibe-coded via Gemini 2.5 Pro, and I can't make any promises about similar results on machines besides my own.
The readme below has been slightly modified to reflect these updates.
by Minyuan Ye, Dong Lyu and Gengsheng Chen
pdf [main][backup]
(a) Result of Nah et al. (b) Result of Tao et al. (c) Result of Zhang et al. (d) Our result.
From top to bottom are blurry input, deblurring results of Nah et al., Tao et al., Zhang et al. and ours.
From top to bottom are images restored by Pan et al., Nah et al., Tao et al., Zhang et al. and ours. As space limits, the original blurry images are omitted here.
They can be viewed in Lai dataset with their names, from left to right: boy_statue, pietro, street4 and text1.
- Python 3.9-3.12 (tested with 3.12)
pip(Python package installer)- (Optional, for managing Python versions)
pyenv - Refer to
/code/requirements.txtfor Python package dependencies.
## Installation & Setup
-
Clone the repository:
git clone https://github.com/minyuanye/SIUN.git cd SIUN -
Set up Python Environment (using Python 3.12 recommended):
- If using
pyenv, set the local version:# Ensure Python 3.12.x is installed (e.g., pyenv install 3.12.7) pyenv local 3.12.7
- Create a virtual environment:
python -m venv venv
- If using
-
Activate the Virtual Environment:
- Important: You must activate the environment in each new terminal session before running the script.
source venv/bin/activate(Your prompt should now show
(venv)) -
Install Dependencies:
pip install --upgrade pip # Recommended pip install -r code/requirements.txt
Important: Ensure your virtual environment is activated (source venv/bin/activate) in your current terminal session before running any commands.
You can always add --gpu=<gpu_id> to specify GPU ID (not required for CPU execution). The default ID is 0.
-
Deblur a single image:
python code/deblur.py --apply --file-path '</path/to/your/image.png>' --iter <N>
- Replace
</path/to/your/image.png>with the actual path to your input image. - Replace
<N>with the desired number of iterations (e.g.,4,6). Higher numbers take longer but may improve quality. - The output will be saved in the same directory as the input file, with
_deblur<N>added to the filename (e.g.,image_deblur6.png). - Note on Image Size: The script internally pads images so their height and width are multiples of 256 pixels (based on the training patch size). For potentially better results and fewer padding artifacts, consider resizing your input image to dimensions that are already multiples of 256 (e.g., 1024x768, 512x512) before running the script.
- Replace
-
Deblur all images in a folder:
python code/deblur.py --apply --dir-path '</path/to/your/directory/>' --iter <N>
- Replace
</path/to/your/directory/>with the path to the folder containing images. - Replace
<N>with the desired number of iterations. - Outputs will be saved in the same directory as the input images with the
_deblur<N>suffix. - (Note: The original
--result-dirargument is no longer used with this modification)
- Replace
-
Testing the model (Original Method):
python code/deblur.py --test
- Note: This command is intended for the GOPRO dataset and requires setting
test_directory_pathincode/src/config.py. Using Item 2 above is generally recommended for testing on custom images.
- Note: This command is intended for the GOPRO dataset and requires setting
-
Training a new model (Original Method):
python code/deblur.py --train
- Requires removing existing model files in
code/model/and settingtrain_directory_pathincode/src/config.pyto the GOPRO training set. - After training, run
python code/deblur.py --verify.
- Requires removing existing model files in
Please refer to the source code. Most configuration parameters are listed in '/code/src/config.py'.
If you use any part of our code, or SIUN is useful for your research, please consider citing:
@ARTICLE{8963625,
author={M. {Ye} and D. {Lyu} and G. {Chen}},
journal={IEEE Access},
title={Scale-Iterative Upscaling Network for Image Deblurring},
year={2020},
volume={8},
number={},
pages={18316-18325},
keywords={Blind deblurring;curriculum learning;scale-iterative;upscaling network},
doi={10.1109/ACCESS.2020.2967823},
ISSN={2169-3536},
month={},}