Super-Resolution with Diffusion Models
Module: Generative AI | Difficulty: Advanced
SR3
Real-World Degradation
Blind Super-Resolution
Estimate degradation kernel + SR jointly:
Metrics
class SR3(nn.Module):
def __init__(self, unet, vae):
super().__init__()
self.unet = unet
self.vae = vae
def forward(self, x_hr, x_lr, t):
z_hr = self.vae.encode(x_hr)
z_lr = nn.functional.interpolate(self.vae.encode(x_lr), size=z_hr.shape[2:])
noise = torch.randn_like(z_hr)
z_t = scheduler.add_noise(z_hr, noise, t)
return ((noise - self.unet(z_t, t, z_lr))**2).mean()
| Method | PSNR | LPIPS | FID |
|---|---|---|---|
| SR3 | 27.8 | 0.08 | 4.2 |
| StableSR | 28.1 | 0.07 | 3.5 |
| SUPIR | 28.5 | 0.06 | 2.9 |