diff --git a/selfdrive/modeld/models/dmonitoring.cc b/selfdrive/modeld/models/dmonitoring.cc index ea37214d5f..c49be295b5 100644 --- a/selfdrive/modeld/models/dmonitoring.cc +++ b/selfdrive/modeld/models/dmonitoring.cc @@ -19,18 +19,11 @@ static inline T *get_buffer(std::vector &buf, const size_t size) { return buf.data(); } -static inline void init_yuv_buf(std::vector &buf, const int width, int height) { - uint8_t *y = get_buffer(buf, width * height * 3 / 2); - uint8_t *u = y + width * height; - uint8_t *v = u + (width / 2) * (height / 2); -} - void dmonitoring_init(DMonitoringModelState* s) { s->is_rhd = Params().getBool("IsRHD"); for (int x = 0; x < std::size(s->tensor); ++x) { s->tensor[x] = (x - 128.f) * 0.0078125f; } - init_yuv_buf(s->resized_buf, MODEL_WIDTH, MODEL_HEIGHT); #ifdef USE_ONNX_MODEL s->m = new ONNXModel("../../models/dmonitoring_model.onnx", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME); @@ -49,7 +42,7 @@ static inline auto get_yuv_buf(std::vector &buf, const int width, int h } DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height, float *calib) { - uint8_t *raw_y = (uint8_t *) raw; + uint8_t *raw_y = (uint8_t *) stream_buf; uint8_t *raw_u = raw_y + (width * height); uint8_t *raw_v = raw_u + ((width / 2) * (height / 2));