Hollis71025 commited on
Commit
4dae8a5
·
verified ·
1 Parent(s): bc1094d

FlowPilot-DST streaming ONNX (one frame per call, feature buffer) for small and dune; README

Browse files
README.md CHANGED
@@ -12,8 +12,9 @@ tags:
12
  # Visual Navigation Model Checkpoints
13
 
14
  Pretrained navigation policies trained with [VisNavKit](https://github.com/VAIL-UCLA/visnavkit).
15
- Each folder holds one model: the Lightning checkpoint, its ONNX export, the export metadata
16
- (shapes, anchor times, SHA-256 of both files, PyTorch/ONNX parity) and a sample input batch.
 
17
 
18
  | Folder | VisNavKit config | Model | Params | Val top-1 ADE@1/2/4 s (m) | Val top-1 FDE (m) |
19
  | --- | --- | --- | --- | --- | --- |
@@ -32,6 +33,7 @@ PyTorch/ONNX parity is within 1e-5.
32
  <folder>/flowpilot_dst_<encoder>.onnx # deployment graph
33
  <folder>/flowpilot_dst_<encoder>.metadata.json # shapes, anchor times, hashes, parity
34
  <folder>/flowpilot_dst_<encoder>.inputs.npz # traced sample inputs for a smoke run
 
35
  ```
36
 
37
  ## Usage
@@ -53,7 +55,42 @@ Inputs are the last 20 frames (1, 20, 3, 216, 384) RGB in [0, 1], route patches,
53
  speed/yaw rate and action bounds. The full contract, including frame preparation, is in
54
  [FlowPilot-DST ONNX IO](https://github.com/VAIL-UCLA/visnavkit/blob/dev/docs/flowpilot_dst_onnx.md).
55
 
56
- Re-export from the checkpoint with VisNavKit:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  ```bash
59
  uv run visnavkit-export-dst checkpoint=flowpilot_dst_fastvit_t12.ckpt output=flowpilot_dst_fastvit_t12.onnx
 
12
  # Visual Navigation Model Checkpoints
13
 
14
  Pretrained navigation policies trained with [VisNavKit](https://github.com/VAIL-UCLA/visnavkit).
15
+ Each folder holds one model: the Lightning checkpoint, its two ONNX exports (window and streaming),
16
+ the export metadata (shapes, anchor times, SHA-256 of both files, PyTorch/ONNX parity) and a sample
17
+ input batch.
18
 
19
  | Folder | VisNavKit config | Model | Params | Val top-1 ADE@1/2/4 s (m) | Val top-1 FDE (m) |
20
  | --- | --- | --- | --- | --- | --- |
 
33
  <folder>/flowpilot_dst_<encoder>.onnx # deployment graph
34
  <folder>/flowpilot_dst_<encoder>.metadata.json # shapes, anchor times, hashes, parity
35
  <folder>/flowpilot_dst_<encoder>.inputs.npz # traced sample inputs for a smoke run
36
+ <folder>/flowpilot_dst_<encoder>_streaming.{onnx,metadata.json,inputs.npz} # streaming graph, same weights
37
  ```
38
 
39
  ## Usage
 
55
  speed/yaw rate and action bounds. The full contract, including frame preparation, is in
56
  [FlowPilot-DST ONNX IO](https://github.com/VAIL-UCLA/visnavkit/blob/dev/docs/flowpilot_dst_onnx.md).
57
 
58
+ ### Streaming ONNX
59
+
60
+ `*_streaming.onnx` runs one frame per call. It caches each past frame's features (`[global image
61
+ feature | route latent]`) in a buffer, encodes only the current frame, and decodes only the current
62
+ plan. After 20 frames its decision equals the window graph's (checked at export: DST exact, DUNE
63
+ to 5e-7 in ONNX Runtime).
64
+
65
+ | input | shape | meaning |
66
+ | --- | --- | --- |
67
+ | `vision` | small (1, 2, 3, 216, 384): [previous, current]; dune (1, 1, 3, 216, 384) | the current frame; for small, the previous frame is all zeros on the first call |
68
+ | `route_patch`, `goal`, `ego` | (1, 1, 80, 80), (1, 1, 3), (1, 1, 2) | the current frame's route, goal, `[v, w]` |
69
+ | `action_bounds` | (1, 2, 5) | as in the window graph |
70
+ | `feat_buffer` | (1, 19, F): F = 768 small, 2048 dune | the last call's `feat_buffer_out`; zeros at startup |
71
+ | `buffer_mask` | (1, 19) | the last call's `buffer_mask_out`; zeros at startup |
72
+
73
+ Outputs: `modes`, `probs`, `speed` as in the window graph, plus `feat_buffer_out`, `buffer_mask_out`.
74
+
75
+ ```python
76
+ stem = "flowpilot-dst-dune/flowpilot_dst_dune_vitb14_streaming"
77
+ session = ort.InferenceSession(hf_hub_download(repo, f"{stem}.onnx"))
78
+ buf, mask = np.zeros((1, 19, 2048), np.float32), np.zeros((1, 19), np.float32)
79
+ for frame, route, goal, ego in stream: # 20 Hz, frames exactly 50 ms apart
80
+ modes, probs, speed, buf, mask = session.run(None, dict(
81
+ vision=frame[None, None], route_patch=route[None, None], goal=goal[None, None],
82
+ ego=ego[None, None], action_bounds=bounds, feat_buffer=buf, buffer_mask=mask))
83
+ plan = modes[0, 0] # (80, 5)
84
+ ```
85
+
86
+ - Feed `feat_buffer_out` and `buffer_mask_out` back unchanged.
87
+ - Call once per frame at 20 Hz. Don't skip frames. Reset the buffer (and, for small, the previous
88
+ frame) to zeros after a gap or restart.
89
+ - Keep one buffer per camera stream.
90
+ - CPU latency per call (ONNX Runtime, loaded machine): small 1248 ms window vs 381 ms streaming;
91
+ dune 7537 ms vs 2021 ms.
92
+
93
+ Re-export from the checkpoint with VisNavKit (add `streaming=true` for the streaming graph):
94
 
95
  ```bash
96
  uv run visnavkit-export-dst checkpoint=flowpilot_dst_fastvit_t12.ckpt output=flowpilot_dst_fastvit_t12.onnx
flowpilot-dst-dune/flowpilot_dst_dune_vitb14_streaming.inputs.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49ca7ba15671aef8d5a0a52f96e990e4be08b2cda827c9f5cd677e6f0534663b
3
+ size 1178476
flowpilot-dst-dune/flowpilot_dst_dune_vitb14_streaming.metadata.json ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "exp_name": "flowpilot_dune_dst_clips1k",
3
+ "checkpoint": "logs/visnavkit/th7jpd4m/checkpoints/last.ckpt",
4
+ "checkpoint_sha256": "1380b49fd47aa428a2070a169f8a1eab287c9bb45ac41a49adb796f1253eab7f",
5
+ "onnx_sha256": "0504dace2478c3d89630ceafff31259d25869d013d1a0ab03d53078046708851",
6
+ "precision": "float32",
7
+ "opset": 17,
8
+ "input_shapes": {
9
+ "vision": [
10
+ 1,
11
+ 1,
12
+ 3,
13
+ 216,
14
+ 384
15
+ ],
16
+ "route_patch": [
17
+ 1,
18
+ 1,
19
+ 80,
20
+ 80
21
+ ],
22
+ "goal": [
23
+ 1,
24
+ 1,
25
+ 3
26
+ ],
27
+ "ego": [
28
+ 1,
29
+ 1,
30
+ 2
31
+ ],
32
+ "action_bounds": [
33
+ 1,
34
+ 2,
35
+ 5
36
+ ],
37
+ "feat_buffer": [
38
+ 1,
39
+ 19,
40
+ 2048
41
+ ],
42
+ "buffer_mask": [
43
+ 1,
44
+ 19
45
+ ]
46
+ },
47
+ "output_shapes": {
48
+ "modes": [
49
+ 1,
50
+ 6,
51
+ 80,
52
+ 5
53
+ ],
54
+ "probs": [
55
+ 1,
56
+ 6
57
+ ],
58
+ "speed": [
59
+ 1,
60
+ 1
61
+ ],
62
+ "feat_buffer_out": [
63
+ 1,
64
+ 19,
65
+ 2048
66
+ ],
67
+ "buffer_mask_out": [
68
+ 1,
69
+ 19
70
+ ]
71
+ },
72
+ "streaming": true,
73
+ "pose_fields": [
74
+ "x_m",
75
+ "y_m",
76
+ "yaw_rad",
77
+ "v_mps",
78
+ "w_radps"
79
+ ],
80
+ "target_times_s": [
81
+ 0.05,
82
+ 0.1,
83
+ 0.15000000000000002,
84
+ 0.2,
85
+ 0.25,
86
+ 0.30000000000000004,
87
+ 0.35000000000000003,
88
+ 0.4,
89
+ 0.45,
90
+ 0.5,
91
+ 0.55,
92
+ 0.6000000000000001,
93
+ 0.65,
94
+ 0.7000000000000001,
95
+ 0.75,
96
+ 0.8,
97
+ 0.8500000000000001,
98
+ 0.9,
99
+ 0.9500000000000001,
100
+ 1.0,
101
+ 1.05,
102
+ 1.1,
103
+ 1.1500000000000001,
104
+ 1.2000000000000002,
105
+ 1.25,
106
+ 1.3,
107
+ 1.35,
108
+ 1.4000000000000001,
109
+ 1.4500000000000002,
110
+ 1.5,
111
+ 1.55,
112
+ 1.6,
113
+ 1.6500000000000001,
114
+ 1.7000000000000002,
115
+ 1.75,
116
+ 1.8,
117
+ 1.85,
118
+ 1.9000000000000001,
119
+ 1.9500000000000002,
120
+ 2.0,
121
+ 2.0500000000000003,
122
+ 2.1,
123
+ 2.15,
124
+ 2.2,
125
+ 2.25,
126
+ 2.3000000000000003,
127
+ 2.35,
128
+ 2.4000000000000004,
129
+ 2.45,
130
+ 2.5,
131
+ 2.5500000000000003,
132
+ 2.6,
133
+ 2.6500000000000004,
134
+ 2.7,
135
+ 2.75,
136
+ 2.8000000000000003,
137
+ 2.85,
138
+ 2.9000000000000004,
139
+ 2.95,
140
+ 3.0,
141
+ 3.0500000000000003,
142
+ 3.1,
143
+ 3.1500000000000004,
144
+ 3.2,
145
+ 3.25,
146
+ 3.3000000000000003,
147
+ 3.35,
148
+ 3.4000000000000004,
149
+ 3.45,
150
+ 3.5,
151
+ 3.5500000000000003,
152
+ 3.6,
153
+ 3.6500000000000004,
154
+ 3.7,
155
+ 3.75,
156
+ 3.8000000000000003,
157
+ 3.85,
158
+ 3.9000000000000004,
159
+ 3.95,
160
+ 4.0
161
+ ],
162
+ "top_k": 6,
163
+ "noise": "zero",
164
+ "denoising_steps": 4,
165
+ "num_anchors": 64,
166
+ "parameters_total": 208170577,
167
+ "parity_max_abs_error": {
168
+ "modes": 1.430511474609375e-06,
169
+ "probs": 2.384185791015625e-07,
170
+ "speed": 0.0,
171
+ "feat_buffer_out": 4.410743713378906e-06,
172
+ "buffer_mask_out": 0.0
173
+ }
174
+ }
flowpilot-dst-dune/flowpilot_dst_dune_vitb14_streaming.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0504dace2478c3d89630ceafff31259d25869d013d1a0ab03d53078046708851
3
+ size 829900699
flowpilot-dst-small/flowpilot_dst_fastvit_t12_streaming.inputs.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb225613cd0d9d90e4c87350c7e730719a601501c2d416d2e1df83e6b755722c
3
+ size 2076524
flowpilot-dst-small/flowpilot_dst_fastvit_t12_streaming.metadata.json ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "exp_name": "flowpilot_dst_clips1k",
3
+ "checkpoint": "logs/visnavkit/jaz0uw1a/checkpoints/last.ckpt",
4
+ "checkpoint_sha256": "a45c6cf724ad4b70675f344ef94b6e809268dfff33f78497b8e1a7b446fdf6b8",
5
+ "onnx_sha256": "f6d3e4e1b6cb90250e994bf66270f6887a10843fa2ccaebd896ee46d514c07c6",
6
+ "precision": "float32",
7
+ "opset": 17,
8
+ "input_shapes": {
9
+ "vision": [
10
+ 1,
11
+ 2,
12
+ 3,
13
+ 216,
14
+ 384
15
+ ],
16
+ "route_patch": [
17
+ 1,
18
+ 1,
19
+ 80,
20
+ 80
21
+ ],
22
+ "goal": [
23
+ 1,
24
+ 1,
25
+ 3
26
+ ],
27
+ "ego": [
28
+ 1,
29
+ 1,
30
+ 2
31
+ ],
32
+ "action_bounds": [
33
+ 1,
34
+ 2,
35
+ 5
36
+ ],
37
+ "feat_buffer": [
38
+ 1,
39
+ 19,
40
+ 768
41
+ ],
42
+ "buffer_mask": [
43
+ 1,
44
+ 19
45
+ ]
46
+ },
47
+ "output_shapes": {
48
+ "modes": [
49
+ 1,
50
+ 6,
51
+ 80,
52
+ 5
53
+ ],
54
+ "probs": [
55
+ 1,
56
+ 6
57
+ ],
58
+ "speed": [
59
+ 1,
60
+ 1
61
+ ],
62
+ "feat_buffer_out": [
63
+ 1,
64
+ 19,
65
+ 768
66
+ ],
67
+ "buffer_mask_out": [
68
+ 1,
69
+ 19
70
+ ]
71
+ },
72
+ "streaming": true,
73
+ "pose_fields": [
74
+ "x_m",
75
+ "y_m",
76
+ "yaw_rad",
77
+ "v_mps",
78
+ "w_radps"
79
+ ],
80
+ "target_times_s": [
81
+ 0.05,
82
+ 0.1,
83
+ 0.15000000000000002,
84
+ 0.2,
85
+ 0.25,
86
+ 0.30000000000000004,
87
+ 0.35000000000000003,
88
+ 0.4,
89
+ 0.45,
90
+ 0.5,
91
+ 0.55,
92
+ 0.6000000000000001,
93
+ 0.65,
94
+ 0.7000000000000001,
95
+ 0.75,
96
+ 0.8,
97
+ 0.8500000000000001,
98
+ 0.9,
99
+ 0.9500000000000001,
100
+ 1.0,
101
+ 1.05,
102
+ 1.1,
103
+ 1.1500000000000001,
104
+ 1.2000000000000002,
105
+ 1.25,
106
+ 1.3,
107
+ 1.35,
108
+ 1.4000000000000001,
109
+ 1.4500000000000002,
110
+ 1.5,
111
+ 1.55,
112
+ 1.6,
113
+ 1.6500000000000001,
114
+ 1.7000000000000002,
115
+ 1.75,
116
+ 1.8,
117
+ 1.85,
118
+ 1.9000000000000001,
119
+ 1.9500000000000002,
120
+ 2.0,
121
+ 2.0500000000000003,
122
+ 2.1,
123
+ 2.15,
124
+ 2.2,
125
+ 2.25,
126
+ 2.3000000000000003,
127
+ 2.35,
128
+ 2.4000000000000004,
129
+ 2.45,
130
+ 2.5,
131
+ 2.5500000000000003,
132
+ 2.6,
133
+ 2.6500000000000004,
134
+ 2.7,
135
+ 2.75,
136
+ 2.8000000000000003,
137
+ 2.85,
138
+ 2.9000000000000004,
139
+ 2.95,
140
+ 3.0,
141
+ 3.0500000000000003,
142
+ 3.1,
143
+ 3.1500000000000004,
144
+ 3.2,
145
+ 3.25,
146
+ 3.3000000000000003,
147
+ 3.35,
148
+ 3.4000000000000004,
149
+ 3.45,
150
+ 3.5,
151
+ 3.5500000000000003,
152
+ 3.6,
153
+ 3.6500000000000004,
154
+ 3.7,
155
+ 3.75,
156
+ 3.8000000000000003,
157
+ 3.85,
158
+ 3.9000000000000004,
159
+ 3.95,
160
+ 4.0
161
+ ],
162
+ "top_k": 6,
163
+ "noise": "zero",
164
+ "denoising_steps": 4,
165
+ "num_anchors": 64,
166
+ "parameters_total": 21336514,
167
+ "parity_max_abs_error": {
168
+ "modes": 3.3974647521972656e-06,
169
+ "probs": 3.3080577850341797e-06,
170
+ "speed": 7.450580596923828e-07,
171
+ "feat_buffer_out": 7.62939453125e-06,
172
+ "buffer_mask_out": 0.0
173
+ }
174
+ }
flowpilot-dst-small/flowpilot_dst_fastvit_t12_streaming.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d3e4e1b6cb90250e994bf66270f6887a10843fa2ccaebd896ee46d514c07c6
3
+ size 85721799