【超分代码合集】SwinIR、StableSR、PASD、CCSR 常见超分模型的推理时间对比

时间:2024-04-13 07:11:39

从 Awesome-diffusion-model-for-image-processing 合集 [ 1 ] ^{[1]} [1] 以及 NTIRE 2023 Challenge on Efficient Super-Resolution (CVPR Workshop) [ 2 , 3 ] ^{[2,3]} [2,3] 的超分部分,选取了 4 个 star 数量较高的几个项目进行测试对比。

图像超分论文

模型 论文 Star 数 代码仓库
SwinIR SwinIR: Image Restoration Using Swin Transformer 4k+ 代码
StableSR Exploiting diffusion prior for real-world image super-resolution 1k+ 代码
PASD Pixel-Aware Stable Diffusion for Realistic Image Super-resolution and Personalized Stylization 700+ 代码
CCSR Improving the Stability of Diffusion Models for Content Consistent Super-Resolution 300+ 代码

测试性能

  • 测试的功能为 x4 超分辨率,即不论任何尺寸输入,输出尺寸为输入尺寸的 4 倍
  • 输入输出尺寸单位均为 pixel
  • 硬件:GPU 是 NVIDIA GeForce RTX 3090,显存在 24000MiB左右
  • 均为推理时间,s代表秒
输入 输出 StableSR PASD CCSR SwinIR
120 × 80 480 × 320 8.49s 10.12s 2.67s 0.28s
200 × 200 800 × 800 16.32s 5.72s 4.54s 0.57s
256 x 256 1024 × 1024 35.73s 11.42s 8.93s 0.88s
512 x 512 2048 x 2048 331.04s 135.81s 106.20s 3.95s

基于 Transformer 的 SwinIR 从推理速度上完胜 Diffusion 的模型,而实际的输出结果和前几个模型从视觉上主管感受差异并不大。

[1] https://github.com/lixinustc/Awesome-diffusion-model-for-image-processing/?tab=readme-ov-file#image-super-resolution
[2] https://cvlai.net/ntire/2023/
[3] https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10208768