Skip to content

Commit

Permalink
WD40 model (commaai#32141)
Browse files Browse the repository at this point in the history
* 2eedcd90-b7db-46cb-86be-740f48ded7ab/700

* cleanup some constants

* update model replay ref
  • Loading branch information
YassineYousfi authored Apr 9, 2024
1 parent 99285ef commit 6c3a33a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
3 changes: 0 additions & 3 deletions selfdrive/modeld/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class ModelConstants:
HISTORY_BUFFER_LEN = 99
DESIRE_LEN = 8
TRAFFIC_CONVENTION_LEN = 2
NAV_FEATURE_LEN = 256
NAV_INSTRUCTION_LEN = 150
DRIVING_STYLE_LEN = 12
LAT_PLANNER_STATE_LEN = 4
LATERAL_CONTROL_PARAMS_LEN = 2
PREV_DESIRED_CURV_LEN = 1
Expand Down
8 changes: 0 additions & 8 deletions selfdrive/modeld/modeld.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def __init__(self, context: CLContext):
'traffic_convention': np.zeros(ModelConstants.TRAFFIC_CONVENTION_LEN, dtype=np.float32),
'lateral_control_params': np.zeros(ModelConstants.LATERAL_CONTROL_PARAMS_LEN, dtype=np.float32),
'prev_desired_curv': np.zeros(ModelConstants.PREV_DESIRED_CURV_LEN * (ModelConstants.HISTORY_BUFFER_LEN+1), dtype=np.float32),
'nav_features': np.zeros(ModelConstants.NAV_FEATURE_LEN, dtype=np.float32),
'nav_instructions': np.zeros(ModelConstants.NAV_INSTRUCTION_LEN, dtype=np.float32),
'features_buffer': np.zeros(ModelConstants.HISTORY_BUFFER_LEN * ModelConstants.FEATURE_LEN, dtype=np.float32),
}

Expand Down Expand Up @@ -94,8 +92,6 @@ def run(self, buf: VisionBuf, wbuf: VisionBuf, transform: np.ndarray, transform_

self.inputs['traffic_convention'][:] = inputs['traffic_convention']
self.inputs['lateral_control_params'][:] = inputs['lateral_control_params']
self.inputs['nav_features'][:] = inputs['nav_features']
self.inputs['nav_instructions'][:] = inputs['nav_instructions']

# if getCLBuffer is not None, frame will be None
self.model.setInputBuffer("input_imgs", self.frame.prepare(buf, transform.flatten(), self.model.getCLBuffer("input_imgs")))
Expand Down Expand Up @@ -168,8 +164,6 @@ def main(demo=False):
model_transform_main = np.zeros((3, 3), dtype=np.float32)
model_transform_extra = np.zeros((3, 3), dtype=np.float32)
live_calib_seen = False
nav_features = np.zeros(ModelConstants.NAV_FEATURE_LEN, dtype=np.float32)
nav_instructions = np.zeros(ModelConstants.NAV_INSTRUCTION_LEN, dtype=np.float32)
buf_main, buf_extra = None, None
meta_main = FrameMeta()
meta_extra = FrameMeta()
Expand Down Expand Up @@ -257,8 +251,6 @@ def main(demo=False):
'desire': vec_desire,
'traffic_convention': traffic_convention,
'lateral_control_params': lateral_control_params,
'nav_features': nav_features,
'nav_instructions': nav_instructions,
}

mt1 = time.perf_counter()
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/modeld/models/supercombo.onnx
Git LFS file not shown
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/model_replay_ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60b00d102b3aedcc74a91722d1210cc6905b0c8f
512c45131ff7eb48bf101f9eae50a389efba6930

0 comments on commit 6c3a33a

Please sign in to comment.