document ncnn usage + what we tested / what we did not
Browse files
README.md
CHANGED
|
@@ -54,7 +54,17 @@ Pick a model and run it:
|
|
| 54 |
|
| 55 |
- **ONNX Runtime** (verified): use `onnx/*.onnx` (dynamic H/W). TensorRT /
|
| 56 |
DirectML should work too (same op set) but are untested here.
|
| 57 |
-
- **ncnn** (verified):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
- **chaiNNer**: load the `onnx/*.onnx` files directly. Loading the
|
| 59 |
`.safetensors` via spandrel needs NERVE registered in your chaiNNer/spandrel
|
| 60 |
build (not upstream yet).
|
|
@@ -185,8 +195,14 @@ development log — including dead ends and raw numbers — is in
|
|
| 185 |
variant made thin lines *worse* and was reverted.
|
| 186 |
- **OTF/GAN capability**: the small net trained productively under the full
|
| 187 |
Real-ESRGAN OTF GAN recipe (no collapse).
|
|
|
|
|
|
|
|
|
|
| 188 |
- **Deployability**: dynamic-ONNX export + ORT parity and ncnn conversion were
|
| 189 |
verified at every stage (the numbers are in the log).
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
## Examples
|
| 192 |
|
|
|
|
| 54 |
|
| 55 |
- **ONNX Runtime** (verified): use `onnx/*.onnx` (dynamic H/W). TensorRT /
|
| 56 |
DirectML should work too (same op set) but are untested here.
|
| 57 |
+
- **ncnn** (verified, fp16): `ncnn/*.ncnn.param` + `*.ncnn.bin`. Feed images with
|
| 58 |
+
`Mat.from_pixels`:
|
| 59 |
+
```python
|
| 60 |
+
import ncnn
|
| 61 |
+
net = ncnn.Net(); net.load_param("4x_NERVE_fp16.ncnn.param"); net.load_model("4x_NERVE_fp16.ncnn.bin")
|
| 62 |
+
ex = net.create_extractor()
|
| 63 |
+
ex.input("in0", ncnn.Mat.from_pixels(bgr_uint8, ncnn.Mat.PixelType.PIXEL_BGR2RGB, w, h))
|
| 64 |
+
out = ex.extract("out0")[1] # CHW float, 4x
|
| 65 |
+
```
|
| 66 |
+
(Use `from_pixels`; the ncnn Python binding's raw-array constructor misbehaves
|
| 67 |
+
on large inputs. Outputs are fp16, so expect small deviations at hard edges.)
|
| 68 |
- **chaiNNer**: load the `onnx/*.onnx` files directly. Loading the
|
| 69 |
`.safetensors` via spandrel needs NERVE registered in your chaiNNer/spandrel
|
| 70 |
build (not upstream yet).
|
|
|
|
| 195 |
variant made thin lines *worse* and was reverted.
|
| 196 |
- **OTF/GAN capability**: the small net trained productively under the full
|
| 197 |
Real-ESRGAN OTF GAN recipe (no collapse).
|
| 198 |
+
- **Runtime validation**: every released `.safetensors` loads (strict) and runs;
|
| 199 |
+
every `.onnx` loads in ONNX Runtime; the ncnn models were run at multiple input
|
| 200 |
+
sizes up to 720x720 (2880x2880 output).
|
| 201 |
- **Deployability**: dynamic-ONNX export + ORT parity and ncnn conversion were
|
| 202 |
verified at every stage (the numbers are in the log).
|
| 203 |
+
- **Not tested here** (community welcome): TensorRT / DirectML *speed* and
|
| 204 |
+
fixed-shape static exports, CoreML, and on-device benchmarks. Train more
|
| 205 |
+
variants, benchmark, and share — the arch is standard ops only.
|
| 206 |
|
| 207 |
## Examples
|
| 208 |
|