LatentMux MBT2018-Mean ONNX
ONNX Export of Image Compression Model
2 min read
This model features standardized ONNX graphs for neural image compression based on the mbt2018-mean (Mean-Scale Hyperprior) architecture. It is split into an encoder, decoder, and hyperprior network, prepared for inference via ONNX Runtime across a wide range of devices from CPUs to mobile GPUs. The INT8 quantized variant cuts memory requirements by more than half and speeds up decoding by over 2x with minimal quality loss. This toolkit is useful for developers working on neural image compression and pipeline optimization.
Key features
- Support for ONNX Runtime (CPU, CUDA, DirectML, CoreML, OpenVINO, etc.)
- INT8 quantization reduces hyper_decoder size from 11.4 MB to 2.9 MB
- Decoding speedup of more than 2x compared to FP32
- Included pre-calculated entropy tables cdf_tables.bin
What you can do
- Integrate the image compression model into Python or C++ applications using ONNX Runtime
- Run neural image encoding on mobile devices or in the browser via WebGPU
- Test and benchmark compression speed using the LatentMux CLI utility
Example
import onnxruntime as ort
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="ai-inspire/latentmux-mbt2018-mean-onnx",
filename="encoder_int8.onnx",
)
sess = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
print("Inputs:", [(i.name, i.shape, i.type) for i in sess.get_inputs()])
print("Outputs:", [(o.name, o.shape, o.type) for o in sess.get_outputs()])
Read more
DetailsBenchmarks: FP32 encoding 2003 ms, decoding 1118 ms; INT8 encoding 810 ms, decoding 500 ms
Hardware requirements: peak RAM usage under 80 MB
License: BSD-3-Clause-Clear
Base source: CompressAI (mbt2018-mean q=3)










Comments