Zero-DCE โ€” LiteRT (TFLite) GPU, FP16

On-device LiteRT (.tflite) conversion of Zero-DCE (Zero-Reference Deep Curve Estimation) for low-light image enhancement. The DCE-Net is a tiny 7-layer CNN that estimates pixel-wise tone curves; the curves are applied iteratively (8ร—) to brighten the image. The whole pipeline (curve estimation and the iterative application) is baked into the graph, so the model takes a dark image and returns the enhanced image directly.

The model runs fully on the LiteRT CompiledModel GPU accelerator (ML Drift): every op is GPU-native, no CPU fallback, no Flex/Custom ops. Converted with litert-torch with no patches.

Files

File Precision Size
zerodce_512_fp16.tflite fp16 weights ~0.18 MB
zerodce_512.tflite fp32 ~0.34 MB

I/O

  • Input: [1, 512, 512, 3] float32, NHWC, RGB, range [0, 1] (just divide by 255 โ€” no mean/std normalization).
  • Output: [1, 512, 512, 3] float32, NHWC, RGB, range [0, 1] โ€” the enhanced image. Multiply by 255 to display.

Ops

The graph lowers entirely to GPU-clean builtins โ€” the iterative curve application x = x + rยท(xยฒ โˆ’ x) is written as x*x so it becomes MUL, not POW:

CONV_2D x7, MUL x16, SUB x8, ADD x8, SLICE x8, CONCATENATION x3, TANH x1

No GATHER_ND, no Flex/Custom, no >4D reshapes.

Fidelity

  • Converted fp32 vs original PyTorch: corr 1.0000, max|diff| ~2e-5.
  • fp16 vs fp32: corr 1.0000, max|diff| ~3e-5.

On-device (Pixel 8a, verified)

The fp16 model compiles to 58 / 58 nodes on the LiteRT GPU delegate (LITERT_CL) โ€” full GPU residency, no CPU fallback.

Usage (Android, LiteRT CompiledModel)

val model = CompiledModel.create(
    context.assets, "zerodce_512_fp16.tflite",
    CompiledModel.Options(Accelerator.GPU), null
)
val inputs = model.createInputBuffers()
val outputs = model.createOutputBuffers()
inputs[0].writeFloat(rgbFloats01)   // [1,512,512,3] interleaved RGB in [0,1]
model.run(inputs, outputs)
val enhanced = outputs[0].readFloat()  // [1,512,512,3] in [0,1]

A complete Android sample (live camera + gallery low-light enhancement) is available in google-ai-edge/litert-samples.

License & attribution

  • License: Apache-2.0 (ยฉ the Zero-DCE authors, Li-Chongyi/Zero-DCE). Original work: Guo et al., "Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement", CVPR 2020. This is a format conversion of the official weights (no architectural changes); all credit to the original authors.
Downloads last month
31
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support