--- license: bsd-3-clause library_name: onnx tags: - super-resolution - real-esrgan - onnx - coreml pipeline_tag: image-to-image --- # Real-ESRGAN (RRDBNet) — ONNX ONNX exports of the standard **Real-ESRGAN** RRDBNet upscalers, used by [SceneWorks](https://github.com/michaeltrefry/SceneWorks) to run the `image_upscale` job on Apple Silicon via `onnxruntime` + the CoreML execution provider — so the macOS build needs no Python/PyTorch (epic 3482 "Python Eradication", sc-3489). | file | factor | params | input | output | |---|---|---|---|---| | `real_esrgan_x2.onnx` | 2× | RRDBNet 23-block | `input` `[1,3,h,w]` f32 RGB `[0,1]` | `output` `[1,3,2h,2w]` | | `real_esrgan_x4.onnx` | 4× | RRDBNet 23-block | `input` `[1,3,h,w]` f32 RGB `[0,1]` | `output` `[1,3,4h,4w]` | - Opset 17, **dynamic** height/width (the consumer tiles at 512 px with 16 px pad). - fp32. CoreML EP runs these directly; CPU EP is the fallback. ## Provenance Exported 1:1 from the canonical Real-ESRGAN weights — `RealESRGAN_x2plus.pth` / `RealESRGAN_x4plus.pth` (mirror [`nateraw/real-esrgan`](https://huggingface.co/nateraw/real-esrgan), originals from [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) releases) — with no weight changes. The export reproduces the exact RRDBNet architecture the SceneWorks torch path uses; verified parity against the torch reference (onnxruntime-CPU PSNR ≈ 101 dB, CoreML PSNR ≈ 72–74 dB / visually identical). Reproduce: [`scripts/spikes/sc3489_export_reference.py`](https://github.com/michaeltrefry/SceneWorks/blob/main/scripts/spikes/sc3489_export_reference.py). ``` sha256 real_esrgan_x2.onnx 7115ba92e8a1bfa63d68558ef006ef3d91273a068d321b1439f8bb1c9179002c sha256 real_esrgan_x4.onnx 5c586662929cbc686c1a5c38d9c060dbdb4ea5863a1f7672b8c0761e6b89c033 ``` ## License BSD-3-Clause, following the upstream Real-ESRGAN weights.