Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 719 Bytes

File metadata and controls

35 lines (23 loc) · 719 Bytes

Super-Resolution Tutorial

Enhancing visual quality of satellite imagery with ESRGAN.

Concept

Upscale low-resolution (LR) inputs to high-resolution (HR) outputs.

$$I_{HR} = G(I_{LR})$$

Training

Generator Loss

Combination of pixel loss, perceptual loss, and adversarial loss.

$$\mathcal{L}_G = \lambda_1 \mathcal{L}_{L1} + \lambda_2 \mathcal{L}_{VGG} + \lambda_3 \mathcal{L}_{Adv}$$

Code Example

from ununennium.models.gan import ESRGAN
from ununennium.models.gan.losses import PerceptualLoss

generator = ESRGAN(scale_factor=4)
perceptual_criterion = PerceptualLoss()

# In training loop
fake_hr = generator(lr_img)
loss_p = perceptual_criterion(fake_hr, real_hr)