andriiryzhkov commited on
Commit
0bb636e
·
1 Parent(s): 2de1138

Add RealPLKSR ONNX models, source checkpoints, and model card

Browse files
README.md CHANGED
@@ -1,3 +1,53 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ library_name: onnx
4
+ pipeline_tag: image-to-image
5
+ tags:
6
+ - super-resolution
7
+ - image-restoration
8
+ - photography
9
+ - darktable
10
  ---
11
+
12
+ # RealPLKSR (ONNX)
13
+
14
+ ONNX conversion of [RealPLKSR](https://github.com/dslisleedh/PLKSR) – the Real-world variant of Partial Large Kernel CNNs for Super-Resolution. Includes 2x and 4x scale factors, MSSIM-pretrain stage (no GAN finetune).
15
+
16
+ Packaged for use with [darktable](https://darktable.org)'s neural restore module via the [darktable-ai](https://github.com/darktable-org/darktable-ai) pipeline.
17
+
18
+ ## Files
19
+
20
+ | Path | Purpose |
21
+ |-----------------------------------------------|------------------------------------------------------|
22
+ | `onnx/model_x2.onnx` | 2x upscaler, static input 512×512 → output 1024×1024 |
23
+ | `onnx/model_x4.onnx` | 4x upscaler, static input 256×256 → output 1024×1024 |
24
+ | `checkpoints/2x_realplksr_mssim_pretrain.pth` | Original PyTorch weights for the x2 model |
25
+ | `checkpoints/4x_realplksr_mssim_pretrain.pth` | Original PyTorch weights for the x4 model |
26
+ | `config.json` | HF model metadata |
27
+
28
+ The `checkpoints/` directory holds the original `.pth` files used to produce the ONNX exports. They are kept here so the conversion can be reproduced even if the upstream Google Drive links stop being reachable.
29
+
30
+ ## Source
31
+
32
+ - Architecture and weights: [dslisleedh/PLKSR](https://github.com/dslisleedh/PLKSR) (MIT) – Dongheon Lee et al., Machine Intelligence Laboratory, University of Seoul
33
+ - Paper: [Partial Large Kernel CNNs for Efficient Super-Resolution](https://arxiv.org/abs/2404.11848) (2024)
34
+ - Checkpoint release thread: [dslisleedh/PLKSR#4](https://github.com/dslisleedh/PLKSR/issues/4) ("Real-world PLKSR")
35
+ - Trained via the [neosr](https://github.com/neosr-project/neosr) framework with the RealESRGAN degradation pipeline
36
+ - Conversion code: [darktable-org/darktable-ai](https://github.com/darktable-org/darktable-ai) under GPL-3.0+
37
+ - Original Google Drive links (subject to availability):
38
+ - x2: <https://drive.google.com/file/d/1GAdf5VOqYa5ntswT9sYsKKZ2Z7OQp7gO/view>
39
+ - x4: <https://drive.google.com/file/d/12ek1vitEporWc5qqaYo6AMy0-RYlRqu8/view>
40
+
41
+ ## Usage
42
+
43
+ Inference inputs are RGB images in the [0, 1] range. The graphs have static input dimensions, so callers must tile at exactly the declared size. See the [darktable-ai conversion script](https://github.com/darktable-org/darktable-ai/blob/master/models/upscale-realplksr/convert.py) for the full export configuration, and the [demo script](https://github.com/darktable-org/darktable-ai/blob/master/models/upscale-realplksr/demo.py) for an ONNX Runtime example that handles tiling, mirror-padding, and overlap stitching.
44
+
45
+ ## License
46
+
47
+ - **Model weights** (in `onnx/` and `checkpoints/`): MIT, from upstream [dslisleedh/PLKSR](https://github.com/dslisleedh/PLKSR).
48
+ - **Conversion script and packaging**: GPL-3.0+, see [darktable-org/darktable-ai](https://github.com/darktable-org/darktable-ai).
49
+
50
+ ## Notes
51
+
52
+ - Training dataset is not documented by the weights author; assumed to be DF2K (DIV2K + Flickr2K) per neosr common practice. Flickr2K does not carry an explicit open-source license.
53
+ - MSSIM-pretrain checkpoints only (no GAN finetune) – conservative output, no hallucinated detail.
checkpoints/2x_realplksr_mssim_pretrain.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0214b82d20a2b7d524c9f70828c7a9b0113a3058ff3eb3cabe2b11783645c381
3
+ size 29595266
checkpoints/4x_realplksr_mssim_pretrain.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37a1a6245ea29dc17655b1df64ba5090b0d5ed9d4b50525a722c53e378d552f1
3
+ size 29678402
config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "onnx",
3
+ "library_name": "onnx",
4
+ "architectures": ["RealPLKSR"],
5
+ "task": "image-to-image",
6
+ "pipeline_tag": "image-to-image"
7
+ }
onnx/model_x2.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7abb65092f3808d3aa255ffdab42b1d672883915d90adbdd321204168b9f293
3
+ size 29627920
onnx/model_x4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8ce692652494e2e5c31e1f7c7ab61eb084e9a450cde727a374f5d6746cfe054b
3
+ size 29711010