mlboydaisuke commited on
Commit
8a38f9f
·
verified ·
1 Parent(s): d58edb8

CPGA-Net low-light LiteRT fp16 (fully-GPU, Pixel 8a corr 0.99999, 2ms, 0.1MB)

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +47 -0
  3. cpga_fp16.tflite +3 -0
  4. samples/sample.png +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ samples/sample.png filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: LiteRT
4
+ pipeline_tag: image-to-image
5
+ tags: [litert, tflite, on-device, android, gpu, low-light, image-enhancement, cpga-net]
6
+ base_model: Shyandram/CPGA-Net-Pytorch
7
+ ---
8
+
9
+ # CPGA-Net — LiteRT (on-device low-light enhancement, fully-GPU)
10
+
11
+ [CPGA-Net](https://github.com/Shyandram/CPGA-Net-Pytorch) (Shyandram, IJPRAI), low-light image enhancement
12
+ (brighten dark photos) via Channel Prior + Gamma Correction, converted to **LiteRT** and running **fully on the
13
+ `CompiledModel` GPU** (ML Drift) on Android. **0.025 M params / 0.1 MB fp16 — the smallest model in the
14
+ [LiteRT-Models zoo](https://github.com/john-rocky/LiteRT-Models).**
15
+
16
+ ![CPGA-Net — dark -> enhanced on-device LiteRT GPU](samples/sample.png)
17
+
18
+ ## On-device (Pixel 8a, Tensor G3 — verified)
19
+
20
+ | | |
21
+ |---|---|
22
+ | nodes on GPU | **135 / 135** LITERT_CL (full residency) |
23
+ | inference | **~2 ms** (256×256) |
24
+ | size | **0.1 MB** (fp16) |
25
+ | accuracy | device-vs-PyTorch corr **0.99999**, no NaN |
26
+
27
+ ```
28
+ image[1,3,256,256] (RGB [0,1]) →[GPU: CPGA-Net]→ enhanced[1,3,256,256] ([0,1])
29
+ ```
30
+
31
+ ## How it converts (litert-torch) — three numerically-exact fixes
32
+
33
+ 1. **Gamma correction `x^γ` → `exp(γ·log x)`** — `torch.pow` lowers to the banned `POW`; the identity
34
+ `x^γ = exp(γ·log x)` is exact (base clamped to [1e-9,1]) and uses native `EXP`/`LOG`.
35
+ 2. **CBAM / gamma global pools** → `mean(3).mean(2)` and `F.max_pool2d(x, (H,W))`.
36
+ 3. The dark/bright **channel prior** (`max`/`min` over RGB) stays as `REDUCE_MAX`/`REDUCE_MIN`.
37
+
38
+ Banned ops NONE, ≤4D, tflite-vs-torch corr **1.0**, device-vs-torch corr **0.99999**. Guided-filter disabled.
39
+
40
+ ## Preprocessing
41
+
42
+ Center-crop, resize 256×256, RGB scaled to [0,1], NCHW.
43
+
44
+ ## License
45
+
46
+ [MIT](https://github.com/Shyandram/CPGA-Net-Pytorch/blob/main/LICENSE). Upstream:
47
+ [Shyandram/CPGA-Net-Pytorch](https://github.com/Shyandram/CPGA-Net-Pytorch).
cpga_fp16.tflite ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b125569618cbc342b3c0a095f712dfc899ac739e896208baf13cb1769c4c319
3
+ size 93820
samples/sample.png ADDED

Git LFS Details

  • SHA256: 372de0a06fef879fb4fb0e3d3b5fb67e05c27b1641983fe55c5d36cd7c9cae4f
  • Pointer size: 131 Bytes
  • Size of remote file: 304 kB