nielsr HF Staff commited on
Commit
de43fde
·
verified ·
1 Parent(s): 4b8012c

Add comprehensive model card for GSASR

Browse files

This PR adds a comprehensive model card for the GSASR model.
It includes:
- The paper link: [Generalized and Efficient 2D Gaussian Splatting for Arbitrary-scale Super-Resolution](https://huggingface.co/papers/2501.06838)
- A link to the project page: https://mt-cly.github.io/GSASR.github.io/
- A link to the GitHub repository for code: https://github.com/ChrisDud0257/GSASR
- The `pipeline_tag: image-to-image`, ensuring the model appears in relevant searches.
- The `library_name: pytorch`, reflecting its compatibility.
- The `license: apache-2.0`.
- Detailed installation and sample usage instructions.
- Performance tables and pre-trained model links.
- Citation information and acknowledgements.

Files changed (1) hide show
  1. README.md +282 -0
README.md ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ pipeline_tag: image-to-image
4
+ library_name: pytorch
5
+ tags:
6
+ - super-resolution
7
+ - image-enhancement
8
+ - generative-modeling
9
+ ---
10
+
11
+ # Generalized and Efficient 2D Gaussian Splatting for Arbitrary-scale Super-Resolution (GSASR)
12
+
13
+ This repository contains the official models and code for **GSASR**, a novel method for arbitrary-scale super-resolution, presented in the paper [Generalized and Efficient 2D Gaussian Splatting for Arbitrary-scale Super-Resolution](https://huggingface.co/papers/2501.06838).
14
+
15
+ 📚 [Paper](https://huggingface.co/papers/2501.06838) | 🌐 [Project Page](https://mt-cly.github.io/GSASR.github.io/) | 💻 [Code](https://github.com/ChrisDud0257/GSASR) | 🚀 [Gradio Demo](https://huggingface.co/spaces/mutou0308/GSASR)
16
+
17
+ ## Abstract
18
+ Implicit Neural Representations (INR) have been successfully employed for Arbitrary-scale Super-Resolution (ASR). However, INR-based models need to query the multi-layer perceptron module numerous times and render a pixel in each query, resulting in insufficient representation capability and low computational efficiency. Recently, Gaussian Splatting (GS) has shown its advantages over INR in both visual quality and rendering speed in 3D tasks, which motivates us to explore whether GS can be employed for the ASR task. However, directly applying GS to ASR is exceptionally challenging because the original GS is an optimization-based method through overfitting each single scene, while in ASR we aim to learn a single model that can generalize to different images and scaling factors. We overcome these challenges by developing two novel techniques. Firstly, to generalize GS for ASR, we elaborately design an architecture to predict the corresponding image-conditioned Gaussians of the input low-resolution image in a feed-forward manner. Each Gaussian can fit the shape and direction of an area of complex textures, showing powerful representation capability. Secondly, we implement an efficient differentiable 2D GPU/CUDA-based scale-aware rasterization to render super-resolved images by sampling discrete RGB values from the predicted continuous Gaussians. Via end-to-end training, our optimized network, namely GSASR, can perform ASR for any image and unseen scaling factors. Extensive experiments validate the effectiveness of our proposed method.
19
+
20
+ ## Overview
21
+
22
+ GSASR achieves state-of-the-art in arbitrary-scale super-resolution by representing given low-resolution images as millions of continuous 2D Gaussians.
23
+
24
+ ![Fast Rasterization](https://github.com/ChrisDud0257/GSASR/raw/main/assets/sampling.png)
25
+
26
+ ## Performance
27
+
28
+ **Comparisons with representative/SoTA ASR models (PSNR/SSIM are tested on Y channel of Ycbcr space).**
29
+
30
+ <div style="overflow-x:auto; font-size:10px;">
31
+ <table>
32
+ <tr>
33
+ <th rowspan="2">Encoder Backbone</th>
34
+ <th rowspan="2">Methods</th>
35
+ <th rowspan="2">Version</th>
36
+ <th rowspan="2">Training Dataset</th>
37
+ <th colspan="3" align="center">PSNR/SSIM/LPIPS/DIST (x4 scaling factor)</th>
38
+ </tr>
39
+ <tr>
40
+ <td align="center">DIV2K</td>
41
+ <td align="center">LSDIR</td>
42
+ <td align="center">Urban100</td>
43
+ </tr>
44
+
45
+ <!-- EDSR Backbone -->
46
+ <tr>
47
+ <td rowspan="6">EDSR</td>
48
+ <td>LIIF</td>
49
+ <td>Paper</td>
50
+ <td>DIV2K</td>
51
+ <td align="center">30.43/0.8388/0.2662/0.1403</td>
52
+ <td align="center">26.21/0.7614/0.2978/0.1678</td>
53
+ <td align="center">26.14/0.7885/0.2271/0.1738</td>
54
+ </tr>
55
+ <tr>
56
+ <td>GaussianSR</td>
57
+ <td>Paper</td>
58
+ <td>DIV2K</td>
59
+ <td align="center">30.46/0.8389/0.2684/0.1406</td>
60
+ <td align="center">26.23/0.7615/0.3007/0.1679</td>
61
+ <td align="center">26.19/0.7893/0.2283/0.1730</td>
62
+ </tr>
63
+ <tr>
64
+ <td>CiaoSR</td>
65
+ <td>Paper</td>
66
+ <td>DIV2K</td>
67
+ <td align="center">30.67/0.8431/0.2585/0.1370</td>
68
+ <td align="center">26.42/0.7681/0.2865/0.1631</td>
69
+ <td align="center">26.69/0.8091/0.2078/0.1659</td>
70
+ </tr>
71
+ <tr>
72
+ <td>GSASR</td>
73
+ <td>Paper Reported</td>
74
+ <td>DIV2K</td>
75
+ <td align="center">30.89/0.8486/0.2518/0.1301</td>
76
+ <td align="center">26.65/0.7774/0.2777/0.1554</td>
77
+ <td align="center">27.01/0.8142/0.1987/0.1552</td>
78
+ </tr>
79
+ <tr>
80
+ <td>GSASR</td>
81
+ <td>Enhanced</td>
82
+ <td>DIV2K</td>
83
+ <td align="center">31.01/0.8509/0.2508/0.1306</td>
84
+ <td align="center">26.78/0.7813/0.2962/0.1543</td>
85
+ <td align="center">27.34/0.8230/0.1920/0.1515</td>
86
+ </tr>
87
+ <tr>
88
+ <td>GSASR</td>
89
+ <td>Enhanced</td>
90
+ <td>DF2K</td>
91
+ <td align="center">31.04/0.8515/0.2512/0.1307</td>
92
+ <td align="center">26.82/0.7827/0.2751/0.1540</td>
93
+ <td align="center">27.45/0.8256/0.1902/0.1507</td>
94
+ </tr>
95
+
96
+ <!-- RDN Backbone -->
97
+ <tr>
98
+ <td rowspan="6">RDN</td>
99
+ <td>LIIF</td>
100
+ <td>Paper</td>
101
+ <td>DIV2K</td>
102
+ <td align="center">30.71/0.8449/0.2566/0.1354</td>
103
+ <td align="center">26.48/0.7714/0.2838/0.1603</td>
104
+ <td align="center">26.71/0.8055/0.2062/0.1562</td>
105
+ </tr>
106
+ <tr>
107
+ <td>GaussianSR</td>
108
+ <td>Paper</td>
109
+ <td>DIV2K</td>
110
+ <td align="center">30.76/0.8457/0.2570/0.1347</td>
111
+ <td align="center">26.53/0.7727/0.2837/0.1595</td>
112
+ <td align="center">26.77/0.8064/0.2069/0.1610</td>
113
+ </tr>
114
+ <tr>
115
+ <td>CiaoSR</td>
116
+ <td>Paper</td>
117
+ <td>DIV2K</td>
118
+ <td align="center">30.91/0.8481/0.2525/0.1327</td>
119
+ <td align="center">26.66/0.7770/0.2768/0.1563</td>
120
+ <td align="center">27.10/0.8142/0.1966/0.1559</td>
121
+ </tr>
122
+ <tr>
123
+ <td>GSASR</td>
124
+ <td>Paper Reported</td>
125
+ <td>DIV2K</td>
126
+ <td align="center">30.96/0.8500/0.2505/0.1288</td>
127
+ <td align="center">26.73/0.7801/0.2752/0.1533</td>
128
+ <td align="center">27.15/0.8177/0.1953/0.1515</td>
129
+ </tr>
130
+ <tr>
131
+ <td>GSASR</td>
132
+ <td>Enhanced</td>
133
+ <td>DIV2K</td>
134
+ <td align="center">31.03/0.8513/0.2499/0.1306</td>
135
+ <td align="center">26.79/0.7819/0.2740/0.1543</td>
136
+ <td align="center">27.37/0.8238/0.1898/0.1511</td>
137
+ </tr>
138
+ <tr>
139
+ <td>GSASR</td>
140
+ <td>Enhanced</td>
141
+ <td>DF2K</td>
142
+ <td align="center">31.10/0.8525/0.2482/0.1296</td>
143
+ <td align="center">26.88/0.7848/0.2709/0.1527</td>
144
+ <td align="center">27.58/0.8289/0.1849/0.1500</td>
145
+ </tr>
146
+
147
+ <!-- SWIN Backbone -->
148
+ <tr>
149
+ <td rowspan="4">SWIN</td>
150
+ <td>CiaoSR</td>
151
+ <td>Paper</td>
152
+ <td>DIV2K</td>
153
+ <td align="center">31.05/0.8511/0.2487/0.1316</td>
154
+ <td align="center">26.80/0.7812/0.2724/0.1552</td>
155
+ <td align="center">27.40/0.8231/0.1869/0.1535</td>
156
+ </tr>
157
+ <tr>
158
+ <td>GSASR</td>
159
+ <td>Paper (not Reported)</td>
160
+ <td>DIV2K</td>
161
+ <td align="center">31.06/0.8521/0.2487/0.1270</td>
162
+ <td align="center">26.84/0.7837/0.2719/0.1503</td>
163
+ <td align="center">27.39/0.8247/0.1913/0.1466</td>
164
+ </tr>
165
+ <tr>
166
+ <td>GSASR</td>
167
+ <td>Enhanced</td>
168
+ <td>DIV2K</td>
169
+ <td align="center">31.10/0.8530/0.2463/0.1285</td>
170
+ <td align="center">26.88/0.7849/0.2690/0.1517</td>
171
+ <td align="center">27.55/0.8280/0.1850/0.1475</td>
172
+ </tr>
173
+ <tr>
174
+ <td>GSASR</td>
175
+ <td>Enhanced</td>
176
+ <td>DF2K</td>
177
+ <td align="center">31.17/0.8541/0.2456/0.1288</td>
178
+ <td align="center">26.96/0.7876/0.2665/0.1513</td>
179
+ <td align="center">27.81/0.8343/0.1781/0.1465</td>
180
+ </tr>
181
+
182
+ <!-- HATL Backbone -->
183
+ <tr>
184
+ <td>HATL</td>
185
+ <td>GSASR</td>
186
+ <td>Ultra Performance</td>
187
+ <td>SA1B</td>
188
+ <td align="center">31.31/0.8570/0.2381/0.1268</td>
189
+ <td align="center">27.17/0.7948/0.2548/0.1470</td>
190
+ <td align="center">28.44/0.8493/0.1580/0.1394</td>
191
+ </tr>
192
+ </table>
193
+ </div>
194
+
195
+ **Comparisons with representative/SoTA ASR models (PSNR/SSIM are tested on Y channel of Ycbcr space).**
196
+
197
+ We provide three versions of GSASR:
198
+ - Paper: the results we reported in our paper. (not reported) means results are not shown in our paper due to limited pages.
199
+ - Enhanced: we introduce [Rotary Position Embedding (ROPE)](https://github.com/naver-ai/rope-vit) with Flash Attention, and utilize Automatic Mixed Precision (AMP) strategy during training/inference to to reduce memory and time cost.
200
+ - Ultra Performance: based on `Enhanced` settings, we explore the performance upper bound of GSASR by introducing [HAT-L](https://github.com/XPixelGroup/HAT) encoder and [SA1B](https://ai.meta.com/datasets/segment-anything/) dataset.
201
+
202
+ ## Pre-trained Models (Enhanced and Ultra Performance Version)
203
+
204
+ | Model Backbone | Training Dataset | Download | Version |
205
+ | :--------------- | :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | :---------------- |
206
+ | EDSR | DIV2K | [Google Drive](https://drive.google.com/drive/folders/1R6ZCdAd6t_2CCpjCK67F9nag9jitMhI6?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/EDSR_DIV2K) | Enhanced |
207
+ | EDSR | DF2K | [Google Drive](https://drive.google.com/drive/folders/16TV2yJt_lfNqJnATtJnEkHV1KoBuW8ww?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/EDSR_DF2K) | Enhanced |
208
+ | RDN | DIV2K | [Google Drive](https://drive.google.com/drive/folders/1guSg28c8gvrTkCvTmNbzqf9vWJfLv58Q?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/RDN_DIV2K) | Enhanced |
209
+ | RDN | DF2K | [Google Drive](https://drive.google.com/drive/folders/1vkBvsiiNqTFKmPtNjPlqMn_mh_ClUrKE?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/RDN_DF2K) | Enhanced |
210
+ | SWIN | DIV2K | [Google Drive](https://drive.google.com/drive/folders/1kVLkOs4KrXlXsPsh0oqvey2dvT6TxqH-?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/SWIN_DIV2K) | Enhanced |
211
+ | SWIN | DF2K | [Google Drive](https://drive.google.com/drive/folders/1ql6dktVUlQFIoPSJkEuvvMPz9TlacMdy?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/SWIN_DF2K) | Enhanced |
212
+ | HATL | SA1B | [Google Drive](https://drive.google.com/drive/folders/1Pn-4JWvlMj50CulmAcBI1Hssiu-6nSYI?usp=sharing), [Hugging Face](https://huggingface.co/mutou0308/GSASR/tree/main/GSASR_enhenced_ultra/HATL-SA1B) | Ultra Performance |
213
+
214
+ ## Usage
215
+
216
+ ### Preparation
217
+ - Pytorch == 2.0 (PyTorch Version must >= 2.0)
218
+ - Anaconda
219
+ - CUDA Toolkit (necessary)
220
+
221
+ Firstly, please make sure you have installed [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit-archive)! Since we have hand-crafted CUDA operators, you need to compile them when you run GSASR.
222
+
223
+ ```bash
224
+ git clone https://github.com/ChrisDud0257/GSASR
225
+ cd GSASR
226
+ conda create --name gsasr python=3.10
227
+ conda activate gsasr
228
+ export CUDA_HOME=${path_to_CUDA} ### specify the path to cuda-11.8
229
+ pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
230
+ python setup_gscuda.py install # gscuda
231
+ cd TrainTestGSASR
232
+ pip install -r requirements.txt
233
+ BASICSR_EXT=True python setup.py develop # basicsr
234
+ ```
235
+
236
+ We have tested that the versions of CUDA from 11.0 to 12.4 are all OK.
237
+
238
+ ### Running Inference
239
+
240
+ You need to properly authenticate with Hugging Face to download our model weights. Once set up, our code will handle it automatically at your first run. You can authenticate by running:
241
+
242
+ ```bash
243
+ # This will prompt you to enter your Hugging Face credentials.
244
+ huggingface-cli login
245
+ ```
246
+
247
+ You can try GSASR easily by launching the Gradio demo or running in command.
248
+
249
+ ### 🚀 Gradio demo
250
+ ```bash
251
+ python demo_gr.py
252
+ ```
253
+
254
+ ### 💻 CLI
255
+ ```bash
256
+ python inference_enhenced.py \
257
+ --input_img_path <path_to_img> \
258
+ --save_sr_path <path_to_saved_folder> \
259
+ --model <{EDSR_DIV2K, EDSR_DF2K, RDN_DIV2K, RDN_DF2K, SWIN_DIV2K,SWIN_DF2K, HATL_SA1B}> \
260
+ --scale <scale> [--tile_process] [--AMP_test]
261
+ ```
262
+ If it fails to access Huggingface, try to manually download pretrained models and specify local path with `--model_path <path_to_model_weight>`.
263
+
264
+ Using `--tile_process` and `--AMP_test` if memory is limited.
265
+
266
+ ## Citation
267
+
268
+ If you find this research helpful for you, please cite our paper.
269
+ ```bibtex
270
+ @article{chen2025generalized,
271
+ title={Generalized and Efficient 2D Gaussian Splatting for Arbitrary-scale Super-Resolution},
272
+ author={Chen, Du and Chen, Liyi and Zhang, Zhengqiang and Zhang, Lei},
273
+ journal={arXiv preprint arXiv:2501.06838},
274
+ year={2025}
275
+ }
276
+ ```
277
+
278
+ ## Acknowledgement
279
+
280
+ This project is built mainly based on the excellent [BasicSR](https://github.com/XPixelGroup/BasicSR), [HAT](https://github.com/XPixelGroup/HAT) and [ROPE-ViT](https://github.com/naver-ai/rope-vit) codeframe. We appreciate it a lot for their developers.
281
+
282
+ We sincerely thank [Mr.Zhengqiang Zhang](https://github.com/xtudbxk) for his support in the CUDA operator of rasterization.