EfRLFN-2x-WebGPU / README.md
PianoNic's picture
EfRLFN 2x converted for WebGPU
8e627d4 verified
|
Raw History Blame Contribute Delete
2.86 kB
---
license: mit
pipeline_tag: image-to-image
tags:
- super-resolution
- video-super-resolution
- webgpu
- wgsl
- real-time
- streaming
---
# EfRLFN-2x-WebGPU
This repository holds the 2x **EfRLFN** checkpoint, converted to a graph weights format that runs in the browser as WGSL compute shaders. It is the `ultra` preset of [ArtPlayerPluginLiveActionSR](https://github.com/PianoNic/ArtPlayerPluginLiveActionSR).
- **Model:** EfRLFN by Bogatyrev et al., *Exploring Real-Time Super-Resolution: Benchmarking and Fine-Tuning for Streaming Content*, ICLR 2026 ([arXiv 2602.11339](https://arxiv.org/abs/2602.11339), [code](https://github.com/EvgeneyBogatyrev/EfRLFN)).
- **Training:** fine-tuned by its authors on compressed streaming video (StreamSR).
- **Weights:** unchanged except that they are stored as float16.
## The network
The model is RGB in, RGB out at 2x, with values 0..1:
```
conv_1 3x3, 3 -> 52
6 x ERLFB x -> tanh(3x3) -> tanh(3x3) -> tanh(3x3) -> + x -> 1x1 -> ECA
ECA: global average pool -> Conv1d(k=3) across channels -> sigmoid -> scale
conv_2 3x3 on (block_6 + conv_1)
upsampler 3x3, 52 -> 12, PixelShuffle(2)
```
- **Size:** 487,010 parameters and about 486k multiply-adds per source pixel.
- **Padding:** zeros, as in PyTorch.
## Speed
Measured in Chrome on an RTX 5080 with WebGPU and shader-f16:
| Source → output | ms / frame |
|---|---|
| 640×360 → 1280×720 | 12.0 |
| 1280×720 → 2560×1440 | 53.9 |
| 1920×1080 → 3840×2160 | 123.0 |
It runs in real time for SD sources on a fast desktop GPU. For HD sources, use the much lighter [LiveActionSR-2x](https://huggingface.co/PianoNic/LiveActionSR-2x) (12k and 48k parameters, 1–10 ms).
## File format
`efrlfn-2x.json` is a DAG under `nodes`:
- **Ops:** `conv` (k×k, any channel count), `add`, `mul`, `activation` (tanh, sigmoid, relu), `global_avg_pool`, `channel_conv` and `depth_to_space`.
- **Weights:** base64 little-endian float16.
- **Input:** `rgb`. **Output:** `rgb`.
The converter, with a numerical check against the upstream PyTorch model, lives in [`tools/efrlfn`](https://github.com/PianoNic/ArtPlayerPluginLiveActionSR/tree/main/tools/efrlfn).
## Use
```ts
import liveActionSR from 'artplayer-plugin-liveaction-sr';
liveActionSR({
models: { ultra: 'https://huggingface.co/PianoNic/EfRLFN-2x-WebGPU/resolve/main/efrlfn-2x.json' },
});
```
## Licence and citation
The weights are MIT, Copyright (c) 2026 MSU Graphics & Media Lab (see `LICENSE`). If you use them, cite the authors:
```bibtex
@article{bogatyrev2026exploring,
title={Exploring Real-Time Super-Resolution: Benchmarking and Fine-Tuning for Streaming Content},
author={Bogatyrev, Evgeney and Abud, Khaled and Molodetskikh, Ivan and Alutis, Nikita and Vatolin, Dmitriy},
journal={arXiv preprint arXiv:2602.11339},
year={2026}
}
```