mirror of
https://github.com/aljazceru/InvSR.git
synced 2025-12-16 22:04:20 +01:00
add huggingface and colab demo
This commit is contained in:
33
README.md
33
README.md
@@ -2,18 +2,19 @@
|
||||
|
||||
[Zongsheng Yue](https://zsyoaoa.github.io/), [Kang Liao](https://kangliao929.github.io/), [Chen Change Loy](https://www.mmlab-ntu.com/person/ccloy/)
|
||||
|
||||
<!--[Paper](https://arxiv.org/abs/2307.12348) | [Project Page](https://zsyoaoa.github.io/projects/resshift/) | [Demo](https://www.youtube.com/watch?v=8DB-6Xvvl5o)-->
|
||||
[](https://arxiv.org/abs/2412.09013) [](https://huggingface.co/spaces/OAOA/InvSR) <a href="https://colab.research.google.com/drive/1hjgCFnAU4oUUhh9VRfTwsFN1AiIjdcSR?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a> 
|
||||
|
||||
<!--<a href="https://colab.research.google.com/drive/1CL8aJO7a_RA4MetanrCLqQO5H7KWO8KI?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a> [](https://replicate.com/cjwbw/resshift)  -->
|
||||
<!--[](https://replicate.com/cjwbw/resshift)-->
|
||||
|
||||
|
||||
:star: If InvSR is helpful to your researches or projects, please help star this repo. Thanks! :hugs:
|
||||
:star: If you've found InvSR useful for your research or projects, please show your support by starring this repo. Thanks! :hugs:
|
||||
|
||||
---
|
||||
>This study presents a new image super-resolution (SR) technique based on diffusion inversion, aiming at harnessing the rich image priors encapsulated in large pre-trained diffusion models to improve SR performance. We design a \textit{Partial noise Prediction} strategy to construct an intermediate state of the diffusion model, which serves as the starting sampling point. Central to our approach is a deep noise predictor to estimate the optimal noise maps for the forward diffusion process. Once trained, this noise predictor can be used to initialize the sampling process partially along the diffusion trajectory, generating the desirable high-resolution result. Compared to existing approaches, our method offers a flexible and efficient sampling mechanism that supports an arbitrary number of sampling steps, ranging from one to five. Even with a single sampling step, our method demonstrates superior or comparable performance to recent state-of-the-art approaches.
|
||||
><img src="./assets/framework.png" align="middle" width="800">
|
||||
---
|
||||
## Update
|
||||
- **2024.12.13**: Add [](https://huggingface.co/spaces/OAOA/InvSR) and <a href="https://colab.research.google.com/drive/1hjgCFnAU4oUUhh9VRfTwsFN1AiIjdcSR?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a>.
|
||||
- **2024.12.11**: Create this repo.
|
||||
|
||||
## Requirements
|
||||
@@ -35,28 +36,32 @@ pip install -r requirements.txt
|
||||
[<img src="assets/real-7.png" height="235"/>](https://imgsli.com/MzI2MTU5) [<img src="assets/real-1.png" height="235"/>](https://imgsli.com/MzI2MTUx) [<img src="assets/real-2.png" height="235"/>](https://imgsli.com/MzI2MTUy)
|
||||
[<img src="assets/real-4.png" height="361"/>](https://imgsli.com/MzI2MTU0) [<img src="assets/real-6.png" height="361"/>](https://imgsli.com/MzI2MTU3) [<img src="assets/real-5.png" height="361"/>](https://imgsli.com/MzI2MTU1)
|
||||
|
||||
### :point_right: General Image Inhancement
|
||||
### :point_right: General Image Enhancement
|
||||
[<img src="assets/enhance-1.png" height="246.5"/>](https://imgsli.com/MzI2MTYw) [<img src="assets/enhance-2.png" height="246.5"/>](https://imgsli.com/MzI2MTYy)
|
||||
[<img src="assets/enhance-3.png" height="207"/>](https://imgsli.com/MzI2MjAx) [<img src="assets/enhance-4.png" height="207"/>](https://imgsli.com/MzI2MjAz) [<img src="assets/enhance-5.png" height="207"/>](https://imgsli.com/MzI2MjA0)
|
||||
[<img src="assets/enhance-3.png" height="207"/>](https://imgsli.com/MzI2MjAx) [<img src="assets/enhance-4.png" height="207"/>](https://imgsli.com/MzI2NTk1) [<img src="assets/enhance-5.png" height="207"/>](https://imgsli.com/MzI2MjA0)
|
||||
|
||||
### :point_right: AIGC Image Inhancement
|
||||
### :point_right: AIGC Image Enhancement
|
||||
[<img src="assets/sdxl-1.png" height="272"/>](https://imgsli.com/MzI2MjQy) [<img src="assets/sdxl-2.png" height="272"/>](https://imgsli.com/MzI2MjQ1) [<img src="assets/sdxl-3.png" height="272"/>](https://imgsli.com/MzI2MjQ3)
|
||||
[<img src="assets/flux-1.png" height="272"/>](https://imgsli.com/MzI2MjQ5) [<img src="assets/flux-2.png" height="272"/>](https://imgsli.com/MzI2MjUw) [<img src="assets/flux-3.png" height="272"/>](https://imgsli.com/MzI2MjUx)
|
||||
|
||||
<!--## Online Demo-->
|
||||
<!--You can try our method through an online demo:-->
|
||||
<!--```-->
|
||||
<!--python app.py-->
|
||||
<!--```-->
|
||||
|
||||
## Inference
|
||||
### :rocket: Fast testing
|
||||
```
|
||||
python inference_invsr.py -i [image folder/image path] -o [result folder] --num_steps 1
|
||||
```
|
||||
1. This script will automatically download the pre-trained [noise predictor](https://huggingface.co/OAOA/InvSR/tree/main) and [SD-Turbo](https://huggingface.co/stabilityai/sd-turbo/tree/main). If you have pre-downloaded them manually, please include them via ``--started_ckpt_path`` and ``--sd_path``.
|
||||
2. To deal with large images, e.g., 1k---->4k, we recommend adding the option ``--chopping_size 256``.
|
||||
3. You can freely adjust the sampling steps via ``--num_steps``.
|
||||
1. **To deal with large images, e.g., 1k---->4k, we recommend adding the option** ``--chopping_size 256``.
|
||||
2. Other options:
|
||||
+ Specify the pre-downloaded [SD Turbo](https://huggingface.co/stabilityai/sd-turbo) Model: ``--sd_path``.
|
||||
+ Specify the pre-downloaded noise predictor: ``--started_ckpt_path``.
|
||||
+ The number of sampling steps: ``--num_steps``.
|
||||
+ If your GPU memory is limited, please add the option ``--chopping_bs 1``.
|
||||
|
||||
### :railway_car: Online Demo
|
||||
You can try our method through an online demo:
|
||||
```
|
||||
python app.py
|
||||
```
|
||||
|
||||
### :airplane: Reproducing our paper results
|
||||
+ Synthetic dataset of ImageNet-Test: [Google Drive](https://drive.google.com/file/d/1PRGrujx3OFilgJ7I6nW7ETIR00wlAl2m/view?usp=sharing).
|
||||
|
||||
Reference in New Issue
Block a user