https://github.com/tencentarc/mm-realsr
Codes for "Metric Learning based Interactive Modulation for Real-World Super-Resolution"
https://github.com/tencentarc/mm-realsr
Last synced: about 1 year ago
JSON representation
Codes for "Metric Learning based Interactive Modulation for Real-World Super-Resolution"
- Host: GitHub
- URL: https://github.com/tencentarc/mm-realsr
- Owner: TencentARC
- License: bsd-3-clause
- Created: 2022-05-09T03:15:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T09:03:37.000Z (over 2 years ago)
- Last Synced: 2025-03-21T13:23:20.193Z (over 1 year ago)
- Language: Python
- Size: 32.9 MB
- Stars: 160
- Watchers: 6
- Forks: 12
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
### 📖 MM-RealSR: Metric Learning based Interactive Modulation for Real-World Super-Resolution
>[](https://arxiv.org/abs/2205.05065)
>[Chong Mou](https://scholar.google.com.hk/citations?user=SYQoDk0AAAAJ&hl=en), Yanze Wu, [Xintao Wang](https://xinntao.github.io/), [Chao Dong](https://scholar.google.com.hk/citations?user=OSDCB0UAAAAJ), [Jian Zhang](https://jianzhang.tech/), [Ying Shan](https://scholar.google.com/citations?user=4oXBp9UAAAAJ&hl=en)
> [Tencent ARC Lab](https://arc.tencent.com/en/ai-demos/imgRestore); Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences
If you want to use the paper model, please go to this [Colab Demo](https://colab.research.google.com/drive/1pIpHK4g2uKdbYXIuskusL9WdwQVZAz1q?usp=sharing) for MM-RealSR
.

---
## 🔧 Dependencies and Installation
- Python >= 3.7 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))
- [PyTorch >= 1.7](https://pytorch.org/)
### Installation
1. Clone repo
```bash
git clone https://github.com/TencentARC/MM-RealSR.git
cd MM-RealSR
```
2. Install dependent packages
```bash
# Install basicsr - https://github.com/xinntao/BasicSR
# We use BasicSR for both training and inference
pip install basicsr
# facexlib and gfpgan are for face enhancement
pip install facexlib
pip install gfpgan
pip install -r requirements.txt
python setup.py develop
```
---
## Training (4 V100 GPUs)
```bash
python -m torch.distributed.launch --nproc_per_node=4 --master_port=4321 mmrealsr/train.py -opt options/MMRealSRNet_x4.yml --launcher pytorch --auto_resume
python -m torch.distributed.launch --nproc_per_node=4 --master_port=4321 mmrealsr/train.py -opt options/MMRealSRGAN_x4.yml --launcher pytorch --auto_resume
```
## :european_castle: Model Zoo
Please download checkpoints from [Google Drive](https://drive.google.com/file/d/10EyZR0SBEXkZIag9rcSgYBupBGllcwdA/view?usp=sharing) or [Github Release](https://github.com/TencentARC/MM-RealSR/releases).
## Testing
```bash
python inference_mmrealsr.py -opt (path to .yml file) --im_path (path to LR images) --model_path (path to checkpoint) --res_path (path to save SR images)
python Metric/LPIPS.py --folder_gt (path to HR images) --folder_restored (path to SR images)
python Metric/NIQE.py --folder_restored (path to SR images)
python Metric/DISTS.py --folder_gt (path to HR images) --folder_restored (path to SR images)
```
Results are in the `results` folder
## Video Demo
Quick start can be found in [Colab Demo](https://colab.research.google.com/drive/1pIpHK4g2uKdbYXIuskusL9WdwQVZAz1q?usp=sharing) for MM-RealSR
.
```bash
python inference_mmrealsr_demo.py -opt (path to .yml file) --model_path (path to checkpoint) --im_path (path to LR image)
```
The visual results of noise and blur modulation:


## BibTeX
@InProceedings{mou2022mmrealsr,
author = {Chong Mou and Yanze Wu and Xintao Wang and Chao Dong and Jian Zhang and Ying Shan},
title = { Metric Learning based Interactive Modulation for Real-World Super-Resolution},
booktitle = {European Conference on Computer Vision (ECCV)},
date = {2022}
}
## 📧 Contact
If you have any question, please email `eechongm@gmail.com`.
## 🤗 Acknowledgement
Thanks to the following open-source projects:
- [Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN).
- [CResMD](https://github.com/hejingwenhejingwen/CResMD).
- [CUGAN](https://github.com/HaomingCai/CUGAN).