Running the IR-SDE Image Restoration Demo with app.py
Overview of IR-SDE
IR-SDE (Image Restoration with Mean-Reverting Stochastic Differential Equations) is a method for general-purpose image restoration using stochastic differential equations. The approach employs a mean-reverting SDE that transforms high-quality images into degraded versions with fixed Gaussian noise. Restoration is achieved by simulating the reverse-time SDE, recovering low-quality images without task-specific priors. The method includes a closed-form solution for the mean-reverting SDE, enabling computation of time-dependent ground truth scores learned by a neural network.
Setup and Dependencies
To run the demonstration, use the same virtual environment as the DA-CLIP project, as both share similar restoraiton model architectures. Before execution, download the pre-trained weights and update the model path in options/test/ir-sde.yml:
path:
pretrain_model_G: E:\\daclip\\pretrained\\rain100h_sde.pth
Note that Windows file paths require double backslashes or raw path strings to avoid parsing errors.
Execution and Results
The app.py script provides a Gradio-based interface for image restoration tasks. The demo supprots single-image super-resolution, inpainting, deraining, denoising, and deblurring using corresponding pre-trained models. Buttons appear in Chinese due to modifications in the Gradio package.