Gokuleshwaran's picture
Update README.md
db5f0b0 verified
---
tags:
- super-resolution
- image-enhancement
- pytorch
- deep-learning
datasets:
- DIV2K
- Set5
license: mit
model-index:
- name: EDSR
results:
- task:
name: Image Super-Resolution
type: image-super-resolution
dataset:
name: DIV2K
type: DIV2K
metrics:
- name: PSNR
type: psnr
value: 30.50
- name: SSIM
type: ssim
value: 0.85
---
# Super Resolution Model Comparison
πŸš€ **Super Resolution Model Comparison** is a web application built using **Streamlit** that allows users to upload a low-resolution image and compare its enhancement using various super-resolution models (SRCNN, VDSR, and EDSR). The application provides image quality metrics (PSNR and SSIM) and processing time for each model to assess their performance.
---
## Features
- **Image Upload**: Upload low-resolution images in PNG, JPG, or JPEG formats.
- **Model Comparison**: Enhance the uploaded image using three popular super-resolution models:
- **SRCNN**: Super-Resolution Convolutional Neural Network.
- **VDSR**: Very Deep Super-Resolution Network.
- **EDSR**: Enhanced Deep Super-Resolution Network.
- **Visual Comparison**: View the enhanced output for each model side-by-side.
- **Performance Metrics**:
- **Processing Time**: Time taken by each model to process the image.
- **Image Quality**:
- **PSNR** (Peak Signal-to-Noise Ratio): Measures the quality of the enhanced image compared to the original.
- **SSIM** (Structural Similarity Index): Assesses structural similarity between the images.
- **Download Enhanced Images**: Download the enhanced images generated by each model.
---
## Installation
### Prerequisites
- Python 3.8 or above
- Pip package manager
### Steps
1. **Clone the Repository**
```bash
git clone <repository-url>
cd <repository-folder>
```
2. **Install Dependencies**
```bash
pip install -r requirements.txt
```
3. **Download Pre-trained Weights**
- Place the pre-trained model weights in the `checkpoints/` directory:
- `srcnn_best.pth` for SRCNN
- `vdsr_best.pth` for VDSR
- `edsr_best.pth` for EDSR
4. **Run the Application**
```bash
streamlit run app.py
```
---
## Usage
1. Open the application in your browser (default URL: `http://localhost:8501`).
2. Upload a low-resolution image using the file uploader.
3. View the enhanced images generated by each model.
4. Compare the performance and quality metrics for each model.
5. Download the enhanced images for further use.
---
## File Structure
```
.
β”œβ”€β”€ app.py # Main Streamlit application script
β”œβ”€β”€ models/ # Directory for model definitions
β”‚ β”œβ”€β”€ srcnn.py # SRCNN model
β”‚ β”œβ”€β”€ vdsr.py # VDSR model
β”‚ └── edsr.py # EDSR model
β”œβ”€β”€ checkpoints/ # Directory for storing pre-trained weights
β”‚ β”œβ”€β”€ srcnn_best.pth
β”‚ β”œβ”€β”€ vdsr_best.pth
β”‚ └── edsr_best.pth
β”œβ”€β”€ requirements.txt # Python dependencies
└── README.md # Documentation
```
---
## Dependencies
Install the required Python libraries:
- `torch`: PyTorch for deep learning.
- `torchvision`: Image transformations and utilities.
- `streamlit`: Interactive web interface.
- `pillow`: Image processing library.
- `numpy`: Numerical operations.
- `scikit-image`: Image quality metrics (PSNR, SSIM).
---
## Models
### 1. SRCNN
- A shallow neural network for super-resolution.
- Faster but may have lower performance on complex images.
### 2. VDSR
- A deeper network providing improved results at the cost of longer processing time.
### 3. EDSR
- Enhanced deep network specifically designed for high-quality super-resolution.
---
## Metrics
- **PSNR**: Measures the similarity of the enhanced image to the original in terms of pixel-level accuracy. Higher values indicate better quality.
- **SSIM**: Evaluates the structural similarity of the enhanced image to the original. Higher values indicate better preservation of structural features.
---
## Customization
### Adding New Models
1. Add the new model definition to the `models/` directory.
2. Update the `load_model()` function in `app.py` to include the new model.
### Updating Pre-trained Weights
Place updated weights in the `checkpoints/` directory with the naming convention `<model_name>_best.pth`.
---
## Future Enhancements
- Support for real-time video super-resolution.
- Integration with additional state-of-the-art super-resolution models.
- GPU acceleration for faster processing.
---
## License
This project is open-source and available under the MIT License.
---
## Contact
For queries or contributions, reach out via GitHub or email.
Happy enhancing! πŸš€