General Introduction
DiffBIR (Blind Image Restoration with Generative Diffusion Prior) is an image restoration tool developed by XPixelGroup, aiming at blind image restoration through generative diffusion model. The tool is capable of handling various image degradation problems such as image super-resolution, image denoising, and face restoration.DiffBIR employs an advanced generative diffusion model to generate high-quality restored images without relying on a specific degradation model. The project is open-sourced on GitHub and provides detailed instructions and pre-trained models to facilitate users in image restoration tasks.
Function List
- Blind Image Super Resolution: Enhances the clarity and detail of low-resolution images.
- Blind face restoration: Repair low-quality or blurred face images.
- Blind image denoising: Removes noise from an image and improves image quality.
- Generating Diffusion Models: Image restoration using generative diffusion modeling for multiple degradation scenarios.
- Pre-trained models: Provides a variety of pre-trained models to support different types of image restoration tasks.
- Online Demo: An online demo is provided so that users can directly experience the image restoration results.
Using Help
Installation process
- clone warehouse::
git clone https://github.com/XPixelGroup/DiffBIR.git
cd DiffBIR
- Installation of dependencies::
pip install -r requirements.txt
- Download pre-trained model: Download the pre-trained model to
models
directory, please refer to the project page for specific model download links.
Instructions for use
Image Restoration
- Preparing the input image: Place the image to be restored in the
inputs
Catalog. - Running inference scripts::
python inference.py --input_dir inputs --output_dir outputs
This command will make a change to theinputs
directory for image restoration and save the results in theoutputs
Catalog.
model training
- Preparing the dataset: Place the training dataset in the
data
directory to ensure that the data format meets the requirements. - Run the training script::
python train_stage1.py --config configs/train_stage1.yaml
python train_stage2.py --config configs/train_stage2.yaml
This command will run the first and second stage of training in sequence to generate the final repair model.
Detailed function operation flow
- Blind Image Super Resolution::
- Placing a low-resolution image in the
inputs
Catalog. - Run inference scripts to generate high-resolution images.
- probe
outputs
the resultant image in the catalog to confirm the repair effect.
- Placing a low-resolution image in the
- Blind face restoration::
- Placing a blurry or low-quality face image in the
inputs
Catalog. - Run the inference script to repair the face image.
- probe
outputs
the resultant image in the catalog to confirm the repair effect.
- Placing a blurry or low-quality face image in the
- Blind image denoising::
- The image containing the noise is placed in the
inputs
Catalog. - Run the inference script to remove noise from the image.
- probe
outputs
the resultant image in the catalog to confirm the denoising effect.
- The image containing the noise is placed in the