RealPLKSR for Core ML
Core ML conversions of the RealPLKSR "MSSIM pretrain" upscalers, 2x and 4x, as used by Gumka. These checkpoints were trained without GAN fine-tuning: they sharpen what is in the picture rather than inventing detail.
| Package | Scale | Input | Output | Checkpoint |
|---|---|---|---|---|
RealPLKSR-2x.mlpackage |
2x | [1, 3, 512, 512] float32 | [1, 3, 1024, 1024] float32 | 2x_realplksr_mssim_pretrain.pth (SHA-256 0214b82d20a2…) |
RealPLKSR-4x.mlpackage |
4x | [1, 3, 512, 512] float32 | [1, 3, 2048, 2048] float32 | 4x_realplksr_mssim_pretrain.pth (SHA-256 37a1a6245ea2…) |
- Values are planar RGB from 0 to 1, in and out. Compute is float16; input and output are float32, so 16-bit pictures keep their precision.
- The tile size is fixed. Larger pictures are run in tiles with 16 px of context on each side, writing only each tile's core.
- Run them on CPU and GPU. On the Neural Engine the results are inaccurate.
- About 1.3 s (2x) and 1.5 s (4x) per tile on an M4 with CPU and GPU.
- ML Program, macOS 13 or later.
Source and license
- Architecture: PLKSR, "Partial Large Kernel CNNs for Efficient Super-Resolution", Dongheon Lee et al., https://github.com/dslisleedh/PLKSR (MIT).
- RealPLKSR and these weights: neosr-project, released under the same MIT license in https://github.com/dslisleedh/PLKSR/issues/4.
- Checkpoints fetched from darktable's mirror, https://huggingface.co/darktable-org/upscale-realplksr-onnx, and checked by SHA-256.
- The weights are stored as float16; nothing else changes. License: MIT, see
LICENSE.
Conversion
tools/convert/realplksr/convert.py in the Gumka repository: spandrel loads the checkpoint,
torch.jit.trace traces it at the tile size, and coremltools 9.0 converts it. The script
checks each package against PyTorch on generated tiles.
- Downloads last month
- -