diff --git a/models/supercombo.dlc b/models/supercombo.dlc index a27e3d1180..e46a5ef679 100644 --- a/models/supercombo.dlc +++ b/models/supercombo.dlc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ba3fe3e61853cc1434e3e220f40c8e9d1f1b9bab8458196ba3bea6a10b82c6ed -size 72718099 +oid sha256:d7e58be246bb9fb27e1f7a60ab2ed1ec4ee7bdc99cf82d92af694f77c83e43aa +size 108294663 diff --git a/models/supercombo.onnx b/models/supercombo.onnx index 3039035fbc..9efe640760 100644 --- a/models/supercombo.onnx +++ b/models/supercombo.onnx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bda57c1a66944f5a633ecd739a24d62702c717a234f2fdcc499dfa1d61c3c19e -size 73147489 +oid sha256:9b0c23ca7198d945303f407cf374c9e5cffc13e0ca2fde3420748e7fbb3eddf8 +size 108687135 diff --git a/selfdrive/modeld/models/driving.cc b/selfdrive/modeld/models/driving.cc index e14411df78..696e36078f 100644 --- a/selfdrive/modeld/models/driving.cc +++ b/selfdrive/modeld/models/driving.cc @@ -228,19 +228,24 @@ void fill_plan(cereal::ModelDataV2::Builder &framed, const ModelOutputPlanPredic void fill_lane_lines(cereal::ModelDataV2::Builder &framed, const std::array &plan_t, const ModelOutputLaneLines &lanes) { + + const auto &left_far = lanes.get_lane_idx(0); + const auto &left_near = lanes.get_lane_idx(1); + const auto &right_near = lanes.get_lane_idx(2); + const auto &right_far = lanes.get_lane_idx(3); std::array left_far_y, left_far_z; std::array left_near_y, left_near_z; std::array right_near_y, right_near_z; std::array right_far_y, right_far_z; for (int j=0; j left_far; - std::array left_near; - std::array right_near; - std::array right_far; -}; -static_assert(sizeof(ModelOutputLinesXY) == sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*4); - struct ModelOutputLineProbVal { float val_deprecated; float val; @@ -99,12 +93,28 @@ struct ModelOutputLinesProb { }; static_assert(sizeof(ModelOutputLinesProb) == sizeof(ModelOutputLineProbVal)*4); +struct ModelOutputLaneLinesElement { + std::array mean; + std::array std; + std::array prob; +}; +static_assert(sizeof(ModelOutputLaneLinesElement) == (sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*2) + sizeof(float)*LANELINES_MHP_N); + struct ModelOutputLaneLines { - ModelOutputLinesXY mean; - ModelOutputLinesXY std; + std::array prediction; ModelOutputLinesProb prob; + + constexpr const ModelOutputLaneLinesElement &get_lane_idx(int lane_idx) const { + int max_idx = 0; + for (int i = 1; i < prediction.size(); i++) { + if (prediction[i].prob[lane_idx] > prediction[max_idx].prob[lane_idx]) { + max_idx = i; + } + } + return prediction[max_idx]; + } }; -static_assert(sizeof(ModelOutputLaneLines) == (sizeof(ModelOutputLinesXY)*2) + sizeof(ModelOutputLinesProb)); +static_assert(sizeof(ModelOutputLaneLines) == (sizeof(ModelOutputLaneLinesElement)*LANELINES_MHP_N) + (sizeof(ModelOutputLinesProb))); struct ModelOutputEdgessXY { std::array left; diff --git a/selfdrive/test/process_replay/model_replay_ref_commit b/selfdrive/test/process_replay/model_replay_ref_commit index bf4e1eadb8..1f652422f7 100644 --- a/selfdrive/test/process_replay/model_replay_ref_commit +++ b/selfdrive/test/process_replay/model_replay_ref_commit @@ -1 +1 @@ -5fb5cd71a6e878cf45593ecea22c93e932f70c31 \ No newline at end of file +885bbd4bc01d474795ae81da734be78b75fa4658