ddcolor-onnx (DDColor tiny, ONNX fp16)
ONNX conversion of DDColor "paper tiny" (ConvNeXt-T encoder, multi-scale colour decoder) for on-device
colorization of black-and-white photos with ONNX Runtime. Used by the ReTint app (com.ipsilondev.retint).
| File | Size | Precision |
|---|---|---|
ddcolor_paper_tiny.onnx |
121,324,284 bytes | fp16 weights and ops, float32 inputs and outputs |
SHA-256 324c626acebe624c3f10fcdf1ca85f3c1ba9e896f1457b2ad5072237e34b5c87
Provenance
- Upstream code: https://github.com/piddnad/DDColor at commit
2adb63f2656ac41cbdf7b894cddd94121a3faf13(Apache-2.0). - Upstream weights: https://huggingface.co/piddnad/ddcolor_paper_tiny at revision
cf9fd99c1d7472689ec7413441c1b799a51866a3(pytorch_model.bin, Apache-2.0, trained on ImageNet). - Conversion script:
convert_ddcolor.pyin this repo. Steps:torch.onnx.export(legacy exporter,dynamo=False), input 1x3x512x512, opset 17,basicsr.archs.ddcolor_arch.DDColorwithencoder_name=convnext-t, decoder_name=MultiScaleColorDecoder, num_output_channels=2, last_norm=Spectral, do_normalize=False, num_queries=100, num_scales=3, dec_layers=9.onnxslim.slim.onnxconverter_common.float16.convert_float_to_float16(..., keep_io_types=True).
- Packages added to the shared venv for this job:
onnxslim,timm,scikit-image.
Tensors
| Name | Shape | Type | Meaning |
|---|---|---|---|
input |
[1, 3, 512, 512] |
float32 | grey RGB in 0-1 (the image's L channel with a=b=0 converted to sRGB). ImageNet mean/std normalisation is inside the graph. |
output |
[1, 2, 512, 512] |
float32 | predicted a and b channels in CIE Lab units (about -128..127), no extra scaling |
Pipeline (as in upstream ddcolor/pipeline.py): L from the full-resolution image (D65 Lab), 512x512 grey copy ->
model -> ab resized bilinearly to the image size -> concatenate with the full-resolution L -> Lab to sRGB.
Verification
Full colorization pipeline on 10 photos (scikit-image sample photos, long edge capped at 768 px), CIEDE2000 between the
PyTorch result and the ONNX result (ORT 1.24 CPU, 4 threads); details in verify_deltaE.json.
| Compared | mean dE2000 | worst p95 dE2000 |
|---|---|---|
| ONNX fp32 (slim) vs PyTorch | 0.00005 | 0.0009 |
| ONNX fp16 (this file) vs PyTorch | 0.027 | 0.208 |
Spec targets: mean <= 1.0, p95 <= 3. On-device latency is not measured yet (no device in the conversion run).
Licence
Apache-2.0, as upstream. Colors are plausible guesses, not the historical record.
Model tree for ipsilondev/ddcolor-onnx
Base model
piddnad/ddcolor_paper_tiny