Skip to content

Ycmmn/Deblur-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deblurring Images with GAN

This is a practice project for deblurring blurry images using a Generative Adversarial Network (GAN). The model is trained to convert blurry images into sharp ones. Evaluation is done using PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index).


📁 Project Structure


project/
├── data/
│   ├── blurred/              # Blurry input images
│   ├── clear/                # Sharp ground truth images
│   ├── Blur\_script.ipynb     # Script for creating blurred images
│   └── data.ipynb            # Data loading and preprocessing
│
├── model/
│   ├── gan.py                # Generator and Discriminator architectures
│   └── gan.ipynb             # Architecture testing or development
│
├── training/
│   ├── train\_loop.ipynb      # Training loop for GAN
│   └── evaluate.ipynb        # Evaluation with PSNR and SSIM
│
├── results/
│   └── sample\_result.png     # Output comparison image (blurry | generated | clear)
│
├── requirements.txt          # Required Python packages
└── README.md                 # Project description


🧠 Models

  • Generator: A U-Net-based network implemented in model/gan.py.
  • Discriminator: A PatchGAN-style discriminator implemented in the same file.

🏋️ Training

The training is handled in training/train_loop.ipynb. It uses paired blurry and sharp images from the data/ folder to train the GAN to reconstruct sharp images.


📊 Evaluation

After training, model performance is evaluated using:

  • PSNR (Peak Signal-to-Noise Ratio)
  • SSIM (Structural Similarity Index)

Evaluation code is in training/evaluate.ipynb.


✅ Requirements

Install dependencies using:

pip install -r requirements.txt

📷 Example Output

The image below shows a blurry input, the generated sharp image, and the original sharp image:

Sample Result


📚 References


✏️ Notes

This project is for learning purposes. You can improve results by:

  • Using a larger dataset
  • Implementing advanced models like DeblurGAN-v2 or ESRGAN
  • Adding perceptual loss (e.g. VGG-based loss)

Releases

No releases published

Packages

 
 
 

Contributors