Upload 5 files
Browse files- checkpoints/mim_final.pt +3 -0
- checkpoints/psnr_0240000.pt +3 -0
- checkpoints/psnr_final.pt +3 -0
- checkpoints/translator_0020000.pt +3 -0
- huggingface_model_card.md +59 -0
checkpoints/mim_final.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a75ed5f67f12aff48ba3ac5232aa1722449f92da714d195c86ce5f9e8bccc9e5
|
| 3 |
+
size 335908431
|
checkpoints/psnr_0240000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:269a5e23e1a6b0dbdc1fd1018f41d558f7099744605c5d47a273cfc24b5430b4
|
| 3 |
+
size 335914149
|
checkpoints/psnr_final.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d862d03283e7c4bcd8d0aac1e22280ff11fbda460babe8823f5e6a7eed9f975b
|
| 3 |
+
size 335910337
|
checkpoints/translator_0020000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed090fc85fc78ac1524fe56cfca621b78c5a8925d83e30aec778e3a4bd9f2b95
|
| 3 |
+
size 5974469
|
huggingface_model_card.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-to-image
|
| 5 |
+
tags:
|
| 6 |
+
- image-restoration
|
| 7 |
+
- denoising
|
| 8 |
+
- image-denoising
|
| 9 |
+
- pytorch
|
| 10 |
+
- low-level-vision
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# DenoiseGAN — detail-preserving single-step image denoiser
|
| 14 |
+
|
| 15 |
+
A single-step image denoiser tuned to remove noise **while preserving fine
|
| 16 |
+
detail**, plus a small **noise-translator** front-end that adapts it to noise it
|
| 17 |
+
was not trained on. Code: **<your-github-url>**.
|
| 18 |
+
|
| 19 |
+
## Files
|
| 20 |
+
|
| 21 |
+
| File | What |
|
| 22 |
+
|------|------|
|
| 23 |
+
| `psnr_final.pt` | The denoiser (PSNR stage). Use the `ema` weights. |
|
| 24 |
+
| `translator_0020000.pt` | Noise translator front-end (~0.37M params). Enable for Gaussian / OOD noise. |
|
| 25 |
+
|
| 26 |
+
## Usage
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
import torch
|
| 30 |
+
from models import DenoiseGenerator, NoiseTranslator # from the GitHub repo
|
| 31 |
+
|
| 32 |
+
D = DenoiseGenerator(channels=(48,96,192,320,448), use_checkpoint=False).eval().cuda()
|
| 33 |
+
D.load_state_dict(torch.load('psnr_final.pt')['ema'], strict=False)
|
| 34 |
+
|
| 35 |
+
T = NoiseTranslator().eval().cuda() # optional
|
| 36 |
+
T.load_state_dict(torch.load('translator_0020000.pt')['ema'])
|
| 37 |
+
|
| 38 |
+
with torch.no_grad():
|
| 39 |
+
out = D(T(noisy)) # noisy normalized to [-1, 1]; drop T for in-distribution noise
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Model
|
| 43 |
+
|
| 44 |
+
- **Generator** (~21M params): NAFNet/Restormer-hybrid U-Net, single forward pass,
|
| 45 |
+
residual noise prediction, attention-gated skips.
|
| 46 |
+
- **Translator** (~0.37M params): bias-free, scale-equivariant residual CNN trained
|
| 47 |
+
*through* the frozen denoiser so `D(T(noisy)) ≈ clean`.
|
| 48 |
+
|
| 49 |
+
## Notes & limitations
|
| 50 |
+
|
| 51 |
+
- Shipped model is the **PSNR (reconstruction) stage**. The adversarial/GAN stage
|
| 52 |
+
was tried and **did not improve** results (it traded fidelity for hallucination).
|
| 53 |
+
- Optimized for **detail preservation** on a specific noise family rather than for
|
| 54 |
+
topping a single PSNR benchmark.
|
| 55 |
+
- For **Gaussian / out-of-distribution** noise, enable the **translator**.
|
| 56 |
+
|
| 57 |
+
## License
|
| 58 |
+
|
| 59 |
+
MIT.
|