Instructions to use Binjia/nafnet-sidd-width32-litert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use Binjia/nafnet-sidd-width32-litert with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
NAFNet-SIDD-width32 (LiteRT / TFLite, bounded)
Real-image denoising for on-device use, converted from
megvii-research/NAFNet (NAFNet-SIDD-width32.pth,
MIT license) to a LiteRT/TFLite model.
| File | nafnet_sidd_w32.tflite (61,780,512 bytes) |
| SHA-256 | 3722dc58227ee81587fa3d988b526b38594056fbf413c37f6b1bbbb9036d8415 |
| Input | float32 NHWC [1, 256, 256, 3], sRGB in [0, 1] |
| Output | float32 NHWC [1, 256, 256, 3], sRGB in [0, 1] (may slightly exceed; clamp) |
| Weights | FP16 storage with DEQUANTIZE; activations FP32 |
| Ops | CONV_2D, DEPTHWISE_CONV_2D, TRANSPOSE_CONV, elementwise, MEAN, RSQRT, RESHAPE (rank ≤ 4, no TRANSPOSE) |
Process images in 256 × 256 tiles (overlap and blend the tiles): channel attention pools over the whole tile and the activation bounds below are calibrated for this tile size.
Differences from the original network
The original FP32 network diverges on low-noise dark input (black, flat dark gray, crushed shadows): outputs reach ±1–8 and appear as coloured grid blocks. The divergence starts at the simplified channel attention (SCA) of the deeper encoder levels and accumulates along the residual stream. This conversion bounds the activations:
- every activation is clamped per channel to its calibrated min/max (+10% margin), measured on real photos with and without Poisson–Gaussian noise;
- the SCA coefficients are clamped to the 0.995 quantile of their per-tile values.
Equivalent rewrites (identical in FP32): LayerNorm computed on a power-of-two pre-scaled input so the variance stays within FP16 range (the model runs correctly with GPU FP16 precision); SimpleGate's channel split folded into the producing convolutions; 1×1 conv + PixelShuffle rewritten as a 2×2 stride-2 transposed convolution.
Measured offline: on normal content the output is within ≤0.1 dB PSNR of the original network at four noise levels; diverging tiles (e.g. pure black: original output [-1.09, 0.75]) produce valid output ([-0.023, 0.017]).
Citation
@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}
}
- Downloads last month
- 10