Views
No views yet
seq_len on the transformer is dynamic.| File / Dir | Purpose |
|---|---|
Vision.onnx (+ .onnx.data) | Vision encoder. Fixed input resolution and temporal size baked in. |
Transformer.onnx (+ .onnx.data) | Transformer decoder layers, embedding mode (no KV cache), dynamic seq_len. |
rotary_params.npz | mRoPE parameters (inv_freq, mrope_section), token embedding weights, and image/grid config (image_height/width, height_factor/width_factor, patch_size, merge_size, hidden_size, head_dim, …). Required alongside the ONNX files at inference time. |
tokenizer/ | HF Qwen3VLProcessor / tokenizer files for text + image preprocessing. |
export_script/ | Scripts used to produce the ONNX files (see Reproducing the export). |
text_prompt_APOv2.1_BF16/ | Sample text prompts (fire / smoke detection) used for downstream evaluation — not required for loading the model. |
| Variable | Value | Notes |
|---|---|---|
IMG_SIZE | (768, 768) | Fixed input resolution — must be a multiple of patch_size × merge_size. |
TEMPORAL_SIZE | 1 | Frames per clip. |
rotary_params.npz around the transformer. High-level flow:tokenizer/.Vision.onnx to obtain visual tokens.rotary_params.npz.Transformer.onnx with mRoPE parameters from rotary_params.npz.x * rsqrt(square(x).sum()) pattern.export_script/ regenerate the ONNX assets from the HF PyTorch checkpoint:1# Install dependencies
2pip install -r export_script/requirements.txt
3
4# Full pipeline
5bash export_script/run_all.sh
6
7# Or run the stages individually
8python export_script/a_export_to_onnx.py
9python export_script/b_export_onnx_vision.pya_export_to_onnx.py — Exports Transformer.onnx and saves rotary_params.npz. Also produces an initial Vision.onnx via a manual path (norm fusion, GELU replacement), which gets overwritten in step b.b_export_onnx_vision.py — Re-exports Vision.onnx by wrapping the HF Qwen3VLVisionModel directly. Traces the exact PyTorch code path, so numerics match HF.qwen3_vl_embedding.py — Model wrapper used by the export scripts.TEMPORAL_SIZE ≤ 2. Beyond that, the Torch vs TRT cosine similarity drops below 0.99 and parity can no longer be guaranteed. If you need longer temporal contexts, the export path will need further investigation (likely around the temporal patching / rotary handling).