Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -10,13 +10,17 @@ tags:
|
|
| 10 |
- nrr
|
| 11 |
---
|
| 12 |
|
| 13 |
-
# NRR
|
| 14 |
|
| 15 |
A 2x neural upscaler as a single ONNX graph of about 461 KB, trained in the
|
| 16 |
[NRR repository](https://github.com/SamurAI-Official/NRR) and used there as *the released model*: the one the
|
| 17 |
Unreal, Godot and Unity plugins load, the one `docs/parity.md` measures, and the one this repository's headless
|
| 18 |
verifications render.
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
It is a prototype model from a research repository rather than a shipping upscaler. It is published so the
|
| 21 |
plugin side of that repository can be verified against a real model instead of a sample.
|
| 22 |
|
|
@@ -50,11 +54,55 @@ That is a comparison of *these frames at this tier*, which is what it is. No row
|
|
| 50 |
upscaler, and a timing taken on a host doing other work is a timing on a busy host. The repository's
|
| 51 |
`docs/evaluation-protocol.md` states the rules the table is held to.
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
## Files
|
| 54 |
|
| 55 |
| file | bytes | what it is |
|
| 56 |
| --- | --- | --- |
|
| 57 |
| `upscale_msreal_scale.onnx` | 461,501 | the released model: the two-tier (`scale` token) upscaler described above |
|
|
|
|
|
|
|
| 58 |
| `phases/upscale_subsampled.onnx` | 424,038 | the 128 -> 256 model `docs/evaluation-protocol.md` names when it explains why a model must be judged at the tier it was trained for |
|
| 59 |
| `phases/upscale_mid.onnx` | 424,038 | mid-training model, kept because the phase tables compare against it |
|
| 60 |
| `phases/upscale_mid_regression.onnx` | 424,038 | the mid model as a regression baseline |
|
|
@@ -66,8 +114,19 @@ upscaler, and a timing taken on a host doing other work is a timing on a busy ho
|
|
| 66 |
With NRR itself:
|
| 67 |
|
| 68 |
```c
|
| 69 |
-
nrr_model_load(device, "upscale_msreal_scale.onnx", &model);
|
| 70 |
-
nrr_render(device, model, /*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
```
|
| 72 |
|
| 73 |
Fetching it into a checkout, which puts it exactly where the repository expects it
|
|
@@ -90,6 +149,11 @@ Trained in the NRR repository's own trainer on frames captured from Godot; the t
|
|
| 90 |
comparison harness, the plugins that load it and every number above live in that repository. The released model
|
| 91 |
is not tracked by git there (`models/phase4/` is working state), which is why it is here.
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
Verification status, stated because a model that loads is not a model that ran: NRR's Unreal project renders this
|
| 94 |
model at three tiers headless and prints `RESULT: PASS` (`engine_plugins/unreal_verify/README.md`), and the Godot
|
| 95 |
addon is verified end to end (`CHANGELOG.md`). Those runs are on a host where the CUDA execution provider
|
|
|
|
| 10 |
- nrr
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# NRR upscalers - the released 2x model, and a 2.5x tier
|
| 14 |
|
| 15 |
A 2x neural upscaler as a single ONNX graph of about 461 KB, trained in the
|
| 16 |
[NRR repository](https://github.com/SamurAI-Official/NRR) and used there as *the released model*: the one the
|
| 17 |
Unreal, Godot and Unity plugins load, the one `docs/parity.md` measures, and the one this repository's headless
|
| 18 |
verifications render.
|
| 19 |
|
| 20 |
+
The same repository publishes a **2.5x** model under [`ratio25/`](#the-25x-tier-ratio25), which is what the
|
| 21 |
+
768x432 -> 1920x1080 tier needs. The released 2x model cannot be asked for that tier: the ratio is the graph's own
|
| 22 |
+
head, so fed a 768x432 frame it returns 1536x864, and it reaches 1920x1080 only from a 960x540 input.
|
| 23 |
+
|
| 24 |
It is a prototype model from a research repository rather than a shipping upscaler. It is published so the
|
| 25 |
plugin side of that repository can be verified against a real model instead of a sample.
|
| 26 |
|
|
|
|
| 54 |
upscaler, and a timing taken on a host doing other work is a timing on a busy host. The repository's
|
| 55 |
`docs/evaluation-protocol.md` states the rules the table is held to.
|
| 56 |
|
| 57 |
+
## The 2.5x tier (`ratio25/`)
|
| 58 |
+
|
| 59 |
+
`ratio25/upscale_25x_procedural_depth.onnx` upscales by **2.5** on both axes, and it is the first model in that
|
| 60 |
+
repository trained at a ratio that is not a power of two *and* qualified at it by the repository's own gates - a
|
| 61 |
+
model that fails one is refused, not exported with a warning next to it.
|
| 62 |
+
|
| 63 |
+
| | |
|
| 64 |
+
| --- | --- |
|
| 65 |
+
| inputs | `color` - the low-resolution frame; `depth` - per-pixel ray distance on the input's grid |
|
| 66 |
+
| output | one frame, **2.5x** the input on both axes (768x432 -> 1920x1080) |
|
| 67 |
+
| spatial | dynamic H/W: the graph takes whatever size the input is |
|
| 68 |
+
| parameters | 90,974 (369,025 bytes) |
|
| 69 |
+
| sha256 | `86326c5d7c4ca5b7b5e7b5e206b55de2909f80a7fee7d1938d3d661545c545d9` |
|
| 70 |
+
| how the ratio is reached | `PixelShuffle(5)` synthesises 25 polyphase components per colour channel, a learned stride-2 convolution selects the phase, and the skip is the 2.5x bilinear upsample - so nothing outside the graph resamples the frame, and an untrained model *is* that ratio's bilinear baseline |
|
| 71 |
+
|
| 72 |
+
Measured on the run's own held-out split (120 procedural pairs, `color` being the noisy packed input the runtime
|
| 73 |
+
supplies), with the 2.5x bilinear baseline scored on the same frames by the same code:
|
| 74 |
+
|
| 75 |
+
| arm | L1 | SSIM | PSNR dB | MS-SSIM |
|
| 76 |
+
| --- | --- | --- | --- | --- |
|
| 77 |
+
| bilinear at 2.5x | 0.02542 | 0.8897 | 21.55 | 0.9427 |
|
| 78 |
+
| **this model** | **0.01058** | **0.9479** | **27.38** | **0.9739** |
|
| 79 |
+
|
| 80 |
+
58.37% below the baseline on the metric the training gates score (the bar is 5%), with training progress 58.9% and
|
| 81 |
+
a `depth` ablation of 0.02742 - the gate that refuses an input the model does not actually use. Through the
|
| 82 |
+
runtime at the tier: **224.6 ms/frame** on an RTX 4070 Ti (CUDA provider, 102.1 ms of it inference) and 2104.3 ms
|
| 83 |
+
on the same host's CPU execution provider; the benchmark seeds a synthetic depth ramp for depth-consuming models,
|
| 84 |
+
so those rows measure speed and the quality numbers above come from the trainer's held-out split instead.
|
| 85 |
+
|
| 86 |
+
What is **not** claimed. The data is procedural - the repository generates it (`tools/gen_training_pairs.py
|
| 87 |
+
--ratio 2.5`, each scene rendered twice, at 128 and at 320, so the target is a real render at the ratio rather
|
| 88 |
+
than a resample onto it) - so the 58.37% is an **in-family** number: held-out pairs, but the same scenes, the same
|
| 89 |
+
renderer and no held-out style. It is not comparable to the 2x table below, which is measured on captured frames
|
| 90 |
+
by a different harness at a different tier. A model trained on *captured* 2.5x pairs, and the commercial
|
| 91 |
+
comparison at this tier, are recorded follow-ups in the repository's roadmap.
|
| 92 |
+
|
| 93 |
+
One thing to know before comparing this model's output across hardware: ONNX Runtime's CUDA execution provider
|
| 94 |
+
computes convolutions in TF32 by default, so this graph's CPU and CUDA outputs differ by up to **6.341e-04** (mean
|
| 95 |
+
1.558e-05) while agreeing to **2.176e-06** with `use_tf32=0`. The two recorded runtime rows therefore carry
|
| 96 |
+
different frame hashes for a named reason rather than a mysterious one, and a re-run on one provider reproduces
|
| 97 |
+
its hash exactly.
|
| 98 |
+
|
| 99 |
## Files
|
| 100 |
|
| 101 |
| file | bytes | what it is |
|
| 102 |
| --- | --- | --- |
|
| 103 |
| `upscale_msreal_scale.onnx` | 461,501 | the released model: the two-tier (`scale` token) upscaler described above |
|
| 104 |
+
| `ratio25/upscale_25x_procedural_depth.onnx` | 369,025 | the 2.5x model: 768x432 -> 1920x1080, inputs `color`, `depth` |
|
| 105 |
+
| `ratio25/upscale_25x_procedural_depth.report.json` | 2,934 | that model's gate report: the configuration, the sha256, the held-out numbers and the baselines they were scored against - the repository gitignores `models/**/*.json`, so this copy is the one that travels with the weights |
|
| 106 |
| `phases/upscale_subsampled.onnx` | 424,038 | the 128 -> 256 model `docs/evaluation-protocol.md` names when it explains why a model must be judged at the tier it was trained for |
|
| 107 |
| `phases/upscale_mid.onnx` | 424,038 | mid-training model, kept because the phase tables compare against it |
|
| 108 |
| `phases/upscale_mid_regression.onnx` | 424,038 | the mid model as a regression baseline |
|
|
|
|
| 114 |
With NRR itself:
|
| 115 |
|
| 116 |
```c
|
| 117 |
+
nrr_model_load(device, "upscale_msreal_scale.onnx", &model);
|
| 118 |
+
nrr_render(device, model, /*references=*/NULL, &input, &output); /* the runtime derives scale from the width */
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
The third argument is the reference set, not the inputs: NRR hands a model the planes it *declares*, and takes
|
| 122 |
+
them from the frame - `NRRFrameInput.color` / `.depth` / `.motion_vectors`, `NRRTemporalState.jitter` and
|
| 123 |
+
`.previous_output` for a temporal model, and `scale` derived from the frame's width. That is the whole difference
|
| 124 |
+
between the two contracts on this page. The released 2x model declares `color`, `jitter`, `scale`, which the
|
| 125 |
+
runtime already has; the 2.5x model declares `color` and `depth`, so a caller has to populate `input.depth`:
|
| 126 |
+
|
| 127 |
+
```c
|
| 128 |
+
nrr_model_load(device, "ratio25/upscale_25x_procedural_depth.onnx", &model);
|
| 129 |
+
nrr_render(device, model, /*references=*/NULL, &input, &output); /* input.depth carries the frame's depth */
|
| 130 |
```
|
| 131 |
|
| 132 |
Fetching it into a checkout, which puts it exactly where the repository expects it
|
|
|
|
| 149 |
comparison harness, the plugins that load it and every number above live in that repository. The released model
|
| 150 |
is not tracked by git there (`models/phase4/` is working state), which is why it is here.
|
| 151 |
|
| 152 |
+
The 2.5x model in `ratio25/` was trained in the same repository, by `tools/run_ratio25.ps1` on data it generates
|
| 153 |
+
rather than data it captured (`tools/gen_training_pairs.py --ratio 2.5`), and its gate report travels with it
|
| 154 |
+
because the repository gitignores `models/**/*.json` - without that copy the artifact's provenance would live only
|
| 155 |
+
in a changelog. The weights are tracked there, so the two copies can be compared byte for byte.
|
| 156 |
+
|
| 157 |
Verification status, stated because a model that loads is not a model that ran: NRR's Unreal project renders this
|
| 158 |
model at three tiers headless and prints `RESULT: PASS` (`engine_plugins/unreal_verify/README.md`), and the Godot
|
| 159 |
addon is verified end to end (`CHANGELOG.md`). Those runs are on a host where the CUDA execution provider
|
ratio25/upscale_25x_procedural_depth.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86326c5d7c4ca5b7b5e7b5e206b55de2909f80a7fee7d1938d3d661545c545d9
|
| 3 |
+
size 369025
|
ratio25/upscale_25x_procedural_depth.report.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "nrr_upscaler_trained",
|
| 3 |
+
"parameters": 90974,
|
| 4 |
+
"inputs": [
|
| 5 |
+
"color",
|
| 6 |
+
"depth"
|
| 7 |
+
],
|
| 8 |
+
"channels": 32,
|
| 9 |
+
"ratio": 2.5,
|
| 10 |
+
"ratio_phases": [
|
| 11 |
+
5,
|
| 12 |
+
2
|
| 13 |
+
],
|
| 14 |
+
"depth_channels": 8,
|
| 15 |
+
"motion_channels": 8,
|
| 16 |
+
"naive_channels": 8,
|
| 17 |
+
"epochs": 60,
|
| 18 |
+
"batch_size": 8,
|
| 19 |
+
"learning_rate": 0.002,
|
| 20 |
+
"seed": 20261111,
|
| 21 |
+
"loss": "l1",
|
| 22 |
+
"ssim_weight": 0.1,
|
| 23 |
+
"lr_schedule": "linear-warmup",
|
| 24 |
+
"detail_weight": 0.0,
|
| 25 |
+
"deterministic": true,
|
| 26 |
+
"zeroed_input": null,
|
| 27 |
+
"input_source": "noisy",
|
| 28 |
+
"task": "upscale",
|
| 29 |
+
"loading": "eager",
|
| 30 |
+
"augmentation": null,
|
| 31 |
+
"device": {
|
| 32 |
+
"used": "cuda",
|
| 33 |
+
"requested": "auto",
|
| 34 |
+
"cuda_available": true,
|
| 35 |
+
"torch": "2.3.1+cu121",
|
| 36 |
+
"cuda_build": "12.1",
|
| 37 |
+
"device_name": "NVIDIA GeForce RTX 4070 Ti",
|
| 38 |
+
"capability": "sm_89",
|
| 39 |
+
"total_memory_mb": 12281
|
| 40 |
+
},
|
| 41 |
+
"gpu": {
|
| 42 |
+
"samples": 713,
|
| 43 |
+
"utilization_percent": {
|
| 44 |
+
"mean": 99.8,
|
| 45 |
+
"max": 100.0
|
| 46 |
+
},
|
| 47 |
+
"memory_used_mb": {
|
| 48 |
+
"mean": 5912,
|
| 49 |
+
"max": 5946.0
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
"gpu_torch_peak_memory_mb": 2858,
|
| 53 |
+
"train_seconds": 328.71,
|
| 54 |
+
"dataset": {
|
| 55 |
+
"dir": "work/pairs25-full",
|
| 56 |
+
"manifest_sha256": "f60f0affc140a2fded9b6c59ff334952781b36082c435daed2b89593fab43975",
|
| 57 |
+
"generator": "gen_training_pairs.py",
|
| 58 |
+
"seed": 20260929,
|
| 59 |
+
"count": 480,
|
| 60 |
+
"sizes": {
|
| 61 |
+
"train": 360,
|
| 62 |
+
"val": 120
|
| 63 |
+
}
|
| 64 |
+
},
|
| 65 |
+
"measured_history": null,
|
| 66 |
+
"measured": {
|
| 67 |
+
"val_l1": 0.010581587441265583,
|
| 68 |
+
"val_baseline_l1": 0.02542012557387352,
|
| 69 |
+
"drift": 0.0180173572152853,
|
| 70 |
+
"depth_ablation": 0.027415452525019646,
|
| 71 |
+
"motion_ablation": 0.0,
|
| 72 |
+
"history_ablation": 0.0,
|
| 73 |
+
"jitter_ablation": 0.0,
|
| 74 |
+
"validity_ablation": 0.0,
|
| 75 |
+
"history_jitter_ablation": 0.0,
|
| 76 |
+
"naive_ablation": 0.0,
|
| 77 |
+
"ssim": 0.9478939458025235,
|
| 78 |
+
"psnr_db": 27.38345883199543,
|
| 79 |
+
"ms_ssim": 0.9738754156013832,
|
| 80 |
+
"baseline_ssim": 0.8897036442761245,
|
| 81 |
+
"baseline_psnr_db": 21.549283483455394,
|
| 82 |
+
"baseline_ms_ssim": 0.9426980902273533,
|
| 83 |
+
"train_first_loss": 0.02584730026622613,
|
| 84 |
+
"train_last_loss": 0.010616115004652076,
|
| 85 |
+
"train_first_l1": 0.02584730026622613,
|
| 86 |
+
"train_last_l1": 0.010616115004652076,
|
| 87 |
+
"train_progress": 0.5892756730758522,
|
| 88 |
+
"objective_progress": 0.5892756730758522,
|
| 89 |
+
"improvement": 0.583731897369492
|
| 90 |
+
},
|
| 91 |
+
"gates": {
|
| 92 |
+
"min_improvement": 0.05,
|
| 93 |
+
"baseline_floor": 0.001,
|
| 94 |
+
"conditioning_floor": 0.0001,
|
| 95 |
+
"failures": []
|
| 96 |
+
},
|
| 97 |
+
"export": {
|
| 98 |
+
"path": "models\\ratio25\\upscale_25x_procedural_depth.onnx",
|
| 99 |
+
"opset": 17,
|
| 100 |
+
"verify": {
|
| 101 |
+
"checked": true,
|
| 102 |
+
"onnxruntime": "1.23.2",
|
| 103 |
+
"max_abs_difference": 8.165836334228516e-06
|
| 104 |
+
},
|
| 105 |
+
"dynamic_size_check": {
|
| 106 |
+
"input_size": 160,
|
| 107 |
+
"output_shape": [
|
| 108 |
+
1,
|
| 109 |
+
3,
|
| 110 |
+
400,
|
| 111 |
+
400
|
| 112 |
+
],
|
| 113 |
+
"expected": [
|
| 114 |
+
1,
|
| 115 |
+
3,
|
| 116 |
+
400,
|
| 117 |
+
400
|
| 118 |
+
],
|
| 119 |
+
"ratio": 2.5
|
| 120 |
+
},
|
| 121 |
+
"sha256": "86326c5d7c4ca5b7b5e7b5e206b55de2909f80a7fee7d1938d3d661545c545d9"
|
| 122 |
+
}
|
| 123 |
+
}
|