Loewolf commited on
Commit
ec4ebe8
·
verified ·
1 Parent(s): 5332960

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +145 -19
README.md CHANGED
@@ -1,27 +1,153 @@
1
- # VOSR-Mobile release package
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- This directory is the upload root for `AllGPTORG/VOSR_1.4B_Mobile`.
4
- Upload its contents to the repository root, so the Hub paths remain
5
- `onnx/...` and `sd8g3/...` rather than `Done/...`.
6
 
7
- ## Contents
 
 
8
 
9
- - `onnx/`: nine reference ONNX graphs.
10
- - `sd8g3/qnn-context/`: eleven SM8650 QNN context binaries and their metadata.
11
- - `sd8g3/wrappers/`: eleven ONNX Runtime EPContext wrappers.
12
- - `sd8g3/vosr_runtime_manifest.json`: app runtime contract and SHA-256 values.
13
 
14
- The QNN package targets Snapdragon 8 Gen 3 (`SM8650`) and QAIRT
15
- `2.45.0.260326154327`. CPU execution fallback is intentionally disabled.
16
 
17
- The staged manifest remains `complete: false` until all QNN files are uploaded.
18
- After the first upload, regenerate it with the immutable Hub commit and publish
19
- that manifest in a second commit:
20
 
21
- ```powershell
22
- python tools\generate_vosr_wrappers.py --blocks-per-context 6 --revision <COMMIT_SHA> --published
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  ```
24
 
25
- The Android app can then bundle the published manifest and download only the
26
- eleven files under `sd8g3/qnn-context/`. The large reference ONNX files are not
27
- downloaded by the app.
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: CSWRY/VOSR
4
+ pipeline_tag: image-to-image
5
+ tags:
6
+ - image-super-resolution
7
+ - image-restoration
8
+ - quantized
9
+ - mobile
10
+ - qualcomm
11
+ - qnn
12
+ - snapdragon
13
+ - npu
14
+ ---
15
 
16
+ # VOSR 1.4B Mobile
 
 
17
 
18
+ `AllGPTORG/VOSR_1.4B_Mobile` is a mobile deployment package of the
19
+ **VOSR-1.4B one-step** image super-resolution model, quantized and compiled as
20
+ Qualcomm QNN DLC graphs for the Snapdragon 8 Gen 3 NPU.
21
 
22
+ The package is designed for high-quality image restoration and super-resolution,
23
+ including text-rich images. It preserves the original one-step VOSR pipeline while
24
+ splitting the network into smaller graphs suitable for mobile integration.
 
25
 
26
+ > This repository contains QNN deployment artifacts. It is not a Transformers or
27
+ > Diffusers checkpoint and cannot be loaded with `from_pretrained()`.
28
 
29
+ ## Model summary
 
 
30
 
31
+ | Property | Value |
32
+ |---|---|
33
+ | Base model | [CSWRY/VOSR](https://huggingface.co/CSWRY/VOSR), VOSR-1.4B one-step |
34
+ | Task | Generative image restoration and super-resolution |
35
+ | Target SoC | Qualcomm Snapdragon 8 Gen 3 / SM8650 |
36
+ | Compile target | Samsung Galaxy S24 family, Android 14 |
37
+ | Runtime format | Qualcomm QNN DLC |
38
+ | Static tile size | 512 x 512 pixels |
39
+ | Batch size | 1 |
40
+ | Activations | FP16 (A16) |
41
+ | DiT block weights | INT4 (W4A16) |
42
+ | Auxiliary/final graph weights | INT8 (W8A16) |
43
+ | Total DLC size | 1,736,469,708 bytes / 1.617 GiB |
44
+
45
+ ## Files
46
+
47
+ The graphs must be executed in the order shown below.
48
+
49
+ | Order | File | Precision | Size |
50
+ |---:|---|---:|---:|
51
+ | 1 | `vosr_dinov2l_layer17.dlc` | W8A16 | 229.50 MiB |
52
+ | 2 | `vosr_qwen_vae_encoder.dlc` | W8A16 | 19.09 MiB |
53
+ | 3 | `vosr_dit_prepare.dlc` | W8A16 | 42.61 MiB |
54
+ | 4 | `vosr_dit_blocks_00_12.dlc` | W4A16 | 444.86 MiB |
55
+ | 5 | `vosr_dit_blocks_12_18.dlc` | W4A16 | 222.62 MiB |
56
+ | 6 | `vosr_dit_blocks_18_24.dlc` | W4A16 | 222.62 MiB |
57
+ | 7 | `vosr_dit_blocks_24_36.dlc` | W4A16 | 444.86 MiB |
58
+ | 8 | `vosr_dit_final.dlc` | W8A16 | 4.90 MiB |
59
+ | 9 | `vosr_qwen_vae_decoder.dlc` | W8A16 | 24.97 MiB |
60
+
61
+ `manifest.json` contains the same graph order, precision assignment, and exact
62
+ byte size for programmatic use.
63
+
64
+ ## Tensor interface
65
+
66
+ All image and latent tensors use NCHW layout.
67
+
68
+ | Graph | Inputs | Outputs |
69
+ |---|---|---|
70
+ | DINOv2-L layer 17 | `lq_image`: FP16 `[1,3,512,512]` | `dino_features`: FP16 `[1,1024,1024]` |
71
+ | Qwen VAE encoder | `lq_image`: FP16 `[1,3,512,512]`; `posterior_noise`: FP16 `[1,16,64,64]` | `lq_latent`: FP16 `[1,16,64,64]` |
72
+ | DiT prepare | `latent_pair`: FP16 `[1,32,64,64]`; `timestep`: FP32 `[1]`; `next_timestep`: FP32 `[1]`; `dino_features`: FP16 `[1,1024,1024]` | `hidden`: FP16 `[1,1024,1536]`; `conditioning`: FP16 `[1,1536]`; `block_conditioning`: FP16 `[1,9216]`; `projected_dino`: FP16 `[1,1024,1536]` |
73
+ | DiT block stages | `hidden`, `block_conditioning`, `projected_dino` | `hidden_out`: FP16 `[1,1024,1536]` |
74
+ | DiT final | `hidden`: FP16 `[1,1024,1536]`; `conditioning`: FP16 `[1,1536]` | `velocity`: FP16 `[1,16,64,64]` |
75
+ | Qwen VAE decoder | `normalized_latent`: FP16 `[1,16,64,64]` | `sr_image`: FP16 `[1,3,512,512]` |
76
+
77
+ ## Integration outline
78
+
79
+ Use the Qualcomm AI Engine Direct SDK / QNN runtime to load and execute the DLCs.
80
+ The host application is responsible for preprocessing, graph orchestration, random
81
+ noise generation, the one-step latent update, tiling, and image postprocessing.
82
+
83
+ 1. Resize the low-resolution image to the requested output resolution using bicubic
84
+ interpolation, split it into 512 x 512 tiles if needed, convert RGB values to
85
+ FP16 NCHW, and normalize them to `[-1, 1]`.
86
+ 2. Run the DINO graph and Qwen VAE encoder on the same image tile. Supply seeded
87
+ normal noise as `posterior_noise` if reproducible output is required.
88
+ 3. Create an FP16 normal-noise latent `z` with shape `[1,16,64,64]`, concatenate
89
+ `lq_latent` and `z` along the channel axis, and use the result as `latent_pair`.
90
+ 4. For the one-step schedule, run DiT prepare with `timestep = [1.0]` and
91
+ `next_timestep = [0.0]`.
92
+ 5. Pass `hidden` sequentially through all four DiT block-stage DLCs. Reuse
93
+ `block_conditioning` and `projected_dino` for every stage.
94
+ 6. Run DiT final and apply the one-step update `z = z - velocity`.
95
+ 7. Decode the updated latent with the Qwen VAE decoder, clamp the output to
96
+ `[-1, 1]`, convert it back to RGB, and blend overlapping tiles when tiling.
97
+
98
+ For 4x super-resolution, bicubic-upscale the source to the final target resolution
99
+ before creating the model tiles. The network then restores detail at that target
100
+ resolution.
101
+
102
+ ## Validation status
103
+
104
+ - All nine graphs were quantized with representative intermediate activations.
105
+ - All nine graphs were successfully compiled to QNN DLC format for SM8650.
106
+ - The Qwen VAE encoder and DiT prepare graphs were profiled on the Snapdragon 8
107
+ Gen 3 NPU.
108
+ - A single pre-linked QNN context is intentionally not included. Linking the entire
109
+ hybrid package exceeded the cloud linker memory limit, so applications should
110
+ execute the DLC sequence or link it with a compatible local QNN SDK.
111
+
112
+ Performance, memory use, and image quality depend on the QNN SDK version, device
113
+ firmware, thermal state, tiling implementation, and host-side orchestration. Test on
114
+ the exact target device before shipping a production application.
115
+
116
+ ## Intended use
117
+
118
+ This package is intended for research and mobile application development involving:
119
+
120
+ - photo and screenshot restoration;
121
+ - text-rich image enhancement;
122
+ - single-image super-resolution;
123
+ - Snapdragon NPU deployment experiments.
124
+
125
+ It is not intended for forensic reconstruction or for recovering information that
126
+ is not present in the source image. Generative restoration can introduce plausible
127
+ but incorrect details.
128
+
129
+ ## Attribution
130
+
131
+ This is a quantized mobile derivative of VOSR. The original architecture, training,
132
+ and checkpoints were created by the VOSR authors. See the
133
+ [official project](https://github.com/cswry/VOSR) and
134
+ [paper](https://arxiv.org/abs/2604.03225) for full details.
135
+
136
+ ## Citation
137
+
138
+ If you use this model, please cite the original VOSR work:
139
+
140
+ ```bibtex
141
+ @inproceedings{wu2026vosr,
142
+ title = {VOSR: A Vision-Only Generative Model for Image Super-Resolution},
143
+ author = {Wu, Rongyuan and Sun, Lingchen and Zhang, Zhengqiang and Kong, Xiangtao and Zhao, Jixin and Wang, Shihao and Zhang, Lei},
144
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
145
+ year = {2026}
146
+ }
147
  ```
148
 
149
+ ## License
150
+
151
+ Released under the Apache License 2.0, following the upstream VOSR repository.
152
+ Users are responsible for reviewing and complying with the licenses and terms of
153
+ all upstream components and the Qualcomm QNN SDK/runtime used for deployment.