Transaction Science
963410a8cc
wai/tools: add wai_jpegai_export_weights.py — reproducible weight export for the decoder
...
The byte-exact JPEG-AI decoder in wai-rs is driven by weights lifted from the reference
ONNX assets, but the export step lived only in scratch and had to be rewritten each time
it was lost. This commits it.
Two regimes, and choosing wrongly yields plausible-but-wrong output:
ptq float nets (synthesis model_y/model_uv, hyper_decoder, MCM stages) -> 16-bit
per-tensor symmetric PTQ (conv -> int16 + mult=round(scale*2^31), shift=31;
bias/LayerNorm/temperature -> Q16), the layout Weights::from_json expects.
int hyper_scale_decoder -> verbatim. That net is integer end to end, so quantizing
it would corrupt an exactly-representable network; IntNet::from_json reads this.
Dependency-free: only the ONNX initializer table is needed, so it reads the protobuf
directly (no onnx/protobuf/torch import).
Verified to reproduce the weights the merged calibration tests were validated against:
synthesis_y 36 conv + 28 scalar (3,341,769 params, worst round-trip 6.6e-05), MCM stage0
3 conv (76,800 params, 6.9e-05), hyper_scale 9 integer tensors. Re-running
jpegai_hyperscale_calibration against freshly exported weights still reproduces the
reference scale indices 40960/40960 exactly.
Documents the eICCI caveat: post_filters/model_*.onnx export the model's `forward`,
which the decoder never calls, and their initializers are BN-folded and incomplete
(no BNY, scaleU/scaleV, or per-block scale) — take the reference state_dict instead.
Co-Authored-By: Claude Opus 4.8 <[email protected] >
2026-07-18 10:12:42 -04:00
..
build_reference_decoders.sh
wai: archive reference-decoder build recipes for reproducible demo
2026-06-20 11:44:42 -04:00
wai_bmshj2018_encode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_bmshj2018_export_onnx.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_bmshj2018_extract_cdfs.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_carriage_demo.sh
wai: archive reference-decoder build recipes for reproducible demo
2026-06-20 11:44:42 -04:00
wai_dac_encode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_dac_export_onnx.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_elic_encode.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_elic_export.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_encodec_decode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_encodec_encode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_encodec_export_onnx.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_generate_model.py
wai.generate.spectral/4: angular (rays) + spiral synthesis primitives
2026-06-27 06:15:35 -04:00
wai_int_audio_export.py
wai: learned integer-exact audio codec (wai.audio.int_codec) + conformance
2026-06-27 17:01:31 -04:00
wai_int_hyper_tiny_vector.py
wai.video.int_hyper: neural-keyframe video — learned int_hyper I-frame + integer P-frames
2026-06-27 07:34:20 -04:00
wai_int_splat_export.py
wai-web: decodeIntSplat binding + per-attr ranges for the in-browser 3D demo
2026-06-28 09:49:40 -04:00
wai_int_synth_export.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_int_synth_qat.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_int_synth_real.py
wai: a real trained int_synth model — real photo, decoded bit-exact everywhere
2026-06-17 17:12:48 -04:00
wai_int_synth_train.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_int_video_demo_encode.py
wai-web: in-browser byte-exact video player (decodeIntVideo)
2026-06-27 08:37:53 -04:00
wai_int_video_encode.py
wai.video.int_motion: deterministic integer inter-frame video (byte-exact)
2026-06-27 07:22:53 -04:00
wai_int_video_keyframe_encode.py
wai.video.int_hyper: neural-keyframe video — learned int_hyper I-frame + integer P-frames
2026-06-27 07:34:20 -04:00
wai_int_video_real_encode.py
wai: half-pel motion compensation for int_motion video + real-footage conformance
2026-06-27 11:10:48 -04:00
wai_int_video_sota_keyframe_encode.py
wai-web: in-browser NEURAL-KEYFRAME video — learned int_hyper I-frame + integer P-frames
2026-06-27 10:07:16 -04:00
wai_int_world2_export.py
wai: two-agent co-control world.model — both agents drive one byte-exact frame
2026-06-28 03:14:57 -04:00
wai_int_world_export.py
wai: world-model trainer — GPU (MPS) device + STEPS CLI arg + longer demo walk
2026-07-01 17:35:31 -04:00
wai_jpegai_export_weights.py
wai/tools: add wai_jpegai_export_weights.py — reproducible weight export for the decoder
2026-07-18 10:12:42 -04:00
wai_jpegai_extract_model_consts.py
wai: JPEG-AI is a live, self-sufficient capability (no schedule fixtures)
2026-06-22 03:11:37 -04:00
wai_jpegai_goldens.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_mbt2018_mean_encode.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_mbt2018_mean_export.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_mimi_encode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_mimi_export_onnx.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_mlicpp_encode.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_mlicpp_export.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_snac_export.py
wai: reconcile the neural + semantic subsystem onto main
2026-06-14 03:55:29 -04:00
wai_sota_int_synth_export.py
wai: compact binary model + in-browser conditional-codec demo
2026-06-25 03:14:46 -04:00
wai_validate_synthetic.py
wai: harden — bump checkout@v5 + neural decoders end-to-end in CI
2026-06-17 01:16:54 -04:00
wai_video_bmshj2018_encode.py
wai: reconcile SPEC §5 neural table with the implemented registry
2026-06-14 11:30:53 -04:00
wai_wavtokenizer_encode.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00
wai_wavtokenizer_export_onnx.py
Add WAI — Web AI Media Transport & Execution standard
2026-05-24 13:36:51 -04:00