|
|
@ -59,8 +59,6 @@ class ModelState: |
|
|
|
'traffic_convention': np.zeros(ModelConstants.TRAFFIC_CONVENTION_LEN, dtype=np.float32), |
|
|
|
'traffic_convention': np.zeros(ModelConstants.TRAFFIC_CONVENTION_LEN, dtype=np.float32), |
|
|
|
'lateral_control_params': np.zeros(ModelConstants.LATERAL_CONTROL_PARAMS_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), |
|
|
|
'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), |
|
|
|
'features_buffer': np.zeros(ModelConstants.HISTORY_BUFFER_LEN * ModelConstants.FEATURE_LEN, dtype=np.float32), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -94,8 +92,6 @@ class ModelState: |
|
|
|
|
|
|
|
|
|
|
|
self.inputs['traffic_convention'][:] = inputs['traffic_convention'] |
|
|
|
self.inputs['traffic_convention'][:] = inputs['traffic_convention'] |
|
|
|
self.inputs['lateral_control_params'][:] = inputs['lateral_control_params'] |
|
|
|
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 |
|
|
|
# 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"))) |
|
|
|
self.model.setInputBuffer("input_imgs", self.frame.prepare(buf, transform.flatten(), self.model.getCLBuffer("input_imgs"))) |
|
|
@ -168,8 +164,6 @@ def main(demo=False): |
|
|
|
model_transform_main = np.zeros((3, 3), dtype=np.float32) |
|
|
|
model_transform_main = np.zeros((3, 3), dtype=np.float32) |
|
|
|
model_transform_extra = np.zeros((3, 3), dtype=np.float32) |
|
|
|
model_transform_extra = np.zeros((3, 3), dtype=np.float32) |
|
|
|
live_calib_seen = False |
|
|
|
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 |
|
|
|
buf_main, buf_extra = None, None |
|
|
|
meta_main = FrameMeta() |
|
|
|
meta_main = FrameMeta() |
|
|
|
meta_extra = FrameMeta() |
|
|
|
meta_extra = FrameMeta() |
|
|
@ -257,8 +251,6 @@ def main(demo=False): |
|
|
|
'desire': vec_desire, |
|
|
|
'desire': vec_desire, |
|
|
|
'traffic_convention': traffic_convention, |
|
|
|
'traffic_convention': traffic_convention, |
|
|
|
'lateral_control_params': lateral_control_params, |
|
|
|
'lateral_control_params': lateral_control_params, |
|
|
|
'nav_features': nav_features, |
|
|
|
|
|
|
|
'nav_instructions': nav_instructions, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mt1 = time.perf_counter() |
|
|
|
mt1 = time.perf_counter() |
|
|
|