Update README.md
Browse files
README.md
CHANGED
|
@@ -24,4 +24,29 @@ This repository contains the trained weights for a high-performance Super Resolu
|
|
| 24 |
- **Purpose:** Uses self-attention to flawlessly reconstruct repeating global textures (fabric, grass, etc.) that CNNs typically over-smooth.
|
| 25 |
|
| 26 |
## The Ensemble Strategy
|
| 27 |
-
To achieve the final Kaggle Leaderboard score, the predictions from these two architectures were mathematically blended using a **75% RealESRNet / 25% SwinIR** ratio. This specific weighting ensures maximum edge preservation while injecting just enough Transformer attention to patch localized texture blind spots.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
- **Purpose:** Uses self-attention to flawlessly reconstruct repeating global textures (fabric, grass, etc.) that CNNs typically over-smooth.
|
| 25 |
|
| 26 |
## The Ensemble Strategy
|
| 27 |
+
To achieve the final Kaggle Leaderboard score, the predictions from these two architectures were mathematically blended using a **75% RealESRNet / 25% SwinIR** ratio. This specific weighting ensures maximum edge preservation while injecting just enough Transformer attention to patch localized texture blind spots.
|
| 28 |
+
|
| 29 |
+
## Validation Results (Competition Metric-Style PSNR)
|
| 30 |
+
|
| 31 |
+
- **RealESRNet (Validation Set):** 39.58 dB
|
| 32 |
+
- **SwinIR (Validation Set):** 39.47 dB
|
| 33 |
+
- **Final 75/25 Ensemble (Kaggle Leaderboard):** 39.501 dB
|
| 34 |
+
|
| 35 |
+
## Files
|
| 36 |
+
|
| 37 |
+
- `best_realesrnet.pth` — best RealESRNet checkpoint (state_dict)
|
| 38 |
+
- `best_swinir.pth` — best SwinIR-Medium checkpoint (state_dict)
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import torch
|
| 44 |
+
from model import RRDBNet # see Kaggle notebook for the class definition
|
| 45 |
+
|
| 46 |
+
# Initialize the RealESRNet Architecture
|
| 47 |
+
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32)
|
| 48 |
+
|
| 49 |
+
# Load the golden weights
|
| 50 |
+
ckpt = torch.load("best_realesrnet.pth", map_location="cpu")
|
| 51 |
+
model.load_state_dict(ckpt['params_ema'] if 'params_ema' in ckpt else ckpt, strict=True)
|
| 52 |
+
model.eval()
|