Simple Baselines for Image Restoration
Paper β’ 2204.04676 β’ Published
GGUF conversion of megvii-research/NAFNet (MIT license) for use with CrispEmbed scan cleanup.
NAFNet (Non-linear Activation Free Network) is a U-Net image restoration model that achieves state-of-the-art denoising without traditional nonlinear activations. Instead it uses SimpleGate (channel split + element-wise multiply) and Simplified Channel Attention.
| File | Type | Size | Notes |
|---|---|---|---|
nafnet-sidd-w32-f16.gguf |
F16 | 56 MB | Full precision weights |
nafnet-sidd-w32-q8_0.gguf |
Q8_0 | 30 MB | Recommended |
nafnet-sidd-w32-q4_k.gguf |
Q4_K | 16 MB | Maximum compression |
# CLI β preprocess scan before OCR
./build/crispembed --cleanup -m ocr_model.gguf --ocr scan.png
# Standalone cleanup
./build/crispembed --cleanup-only scan.png
from crispembed import CrispScanCleanup
cleanup = CrispScanCleanup("nafnet-sidd-w32-q8_0.gguf")
cleaned = cleanup.process("scan.png") # numpy RGB array
Each NAFBlock:
Downsampling: Conv2d stride 2, kernel 2Γ2. Upsampling: Conv1x1 + PixelShuffle(2).
MIT (megvii-research/NAFNet). The GGUF conversion does not change the license.
@article{chen2022simple,
title={Simple Baselines for Image Restoration},
author={Chen, Liangyu and Chu, Xiaojie and Zhang, Xiangyu and Sun, Jian},
journal={arXiv preprint arXiv:2204.04676},
year={2022}
}
8-bit
16-bit
32-bit