Revert "Joint model (#24521)" (#24581)

This reverts commit 9fc732468ee4d4fd135d679a919c748633f06d02.
old-commit-hash: e2e5378dd3
taco
HaraldSchafer 3 years ago committed by GitHub
parent 01c2070a59
commit 3494ec7bbd
  1. 29
      selfdrive/modeld/models/driving.cc
  2. 32
      selfdrive/modeld/models/driving.h
  3. 4
      selfdrive/modeld/models/supercombo.dlc
  4. 4
      selfdrive/modeld/models/supercombo.onnx
  5. 2
      selfdrive/test/process_replay/model_replay_ref_commit

@ -228,24 +228,19 @@ void fill_plan(cereal::ModelDataV2::Builder &framed, const ModelOutputPlanPredic
void fill_lane_lines(cereal::ModelDataV2::Builder &framed, const std::array<float, TRAJECTORY_SIZE> &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<float, TRAJECTORY_SIZE> left_far_y, left_far_z;
std::array<float, TRAJECTORY_SIZE> left_near_y, left_near_z;
std::array<float, TRAJECTORY_SIZE> right_near_y, right_near_z;
std::array<float, TRAJECTORY_SIZE> right_far_y, right_far_z;
for (int j=0; j<TRAJECTORY_SIZE; j++) {
left_far_y[j] = left_far.mean[j].y;
left_far_z[j] = left_far.mean[j].z;
left_near_y[j] = left_near.mean[j].y;
left_near_z[j] = left_near.mean[j].z;
right_near_y[j] = right_near.mean[j].y;
right_near_z[j] = right_near.mean[j].z;
right_far_y[j] = right_far.mean[j].y;
right_far_z[j] = right_far.mean[j].z;
left_far_y[j] = lanes.mean.left_far[j].y;
left_far_z[j] = lanes.mean.left_far[j].z;
left_near_y[j] = lanes.mean.left_near[j].y;
left_near_z[j] = lanes.mean.left_near[j].z;
right_near_y[j] = lanes.mean.right_near[j].y;
right_near_z[j] = lanes.mean.right_near[j].z;
right_far_y[j] = lanes.mean.right_far[j].y;
right_far_z[j] = lanes.mean.right_far[j].z;
}
auto lane_lines = framed.initLaneLines(4);
@ -255,10 +250,10 @@ void fill_lane_lines(cereal::ModelDataV2::Builder &framed, const std::array<floa
fill_xyzt(lane_lines[3], plan_t, X_IDXS_FLOAT, right_far_y, right_far_z);
framed.setLaneLineStds({
exp(left_far.std[0].y),
exp(left_near.std[0].y),
exp(right_near.std[0].y),
exp(right_far.std[0].y),
exp(lanes.std.left_far[0].y),
exp(lanes.std.left_near[0].y),
exp(lanes.std.right_near[0].y),
exp(lanes.std.right_far[0].y),
});
framed.setLaneLineProbs({

@ -28,8 +28,6 @@ constexpr int META_STRIDE = 7;
constexpr int PLAN_MHP_N = 5;
constexpr int STOP_LINE_MHP_N = 3;
constexpr int LANELINES_MHP_N = 4;
constexpr int LEAD_MHP_N = 2;
constexpr int LEAD_TRAJ_LEN = 6;
constexpr int LEAD_PRED_DIM = 4;
@ -79,6 +77,14 @@ struct ModelOutputPlans {
};
static_assert(sizeof(ModelOutputPlans) == sizeof(ModelOutputPlanPrediction)*PLAN_MHP_N);
struct ModelOutputLinesXY {
std::array<ModelOutputYZ, TRAJECTORY_SIZE> left_far;
std::array<ModelOutputYZ, TRAJECTORY_SIZE> left_near;
std::array<ModelOutputYZ, TRAJECTORY_SIZE> right_near;
std::array<ModelOutputYZ, TRAJECTORY_SIZE> right_far;
};
static_assert(sizeof(ModelOutputLinesXY) == sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*4);
struct ModelOutputLineProbVal {
float val_deprecated;
float val;
@ -93,28 +99,12 @@ struct ModelOutputLinesProb {
};
static_assert(sizeof(ModelOutputLinesProb) == sizeof(ModelOutputLineProbVal)*4);
struct ModelOutputLaneLinesElement {
std::array<ModelOutputYZ, TRAJECTORY_SIZE> mean;
std::array<ModelOutputYZ, TRAJECTORY_SIZE> std;
std::array<float, LANELINES_MHP_N> prob;
};
static_assert(sizeof(ModelOutputLaneLinesElement) == (sizeof(ModelOutputYZ)*TRAJECTORY_SIZE*2) + sizeof(float)*LANELINES_MHP_N);
struct ModelOutputLaneLines {
std::array<ModelOutputLaneLinesElement, LANELINES_MHP_N> prediction;
ModelOutputLinesXY mean;
ModelOutputLinesXY std;
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(ModelOutputLaneLinesElement)*LANELINES_MHP_N) + (sizeof(ModelOutputLinesProb)));
static_assert(sizeof(ModelOutputLaneLines) == (sizeof(ModelOutputLinesXY)*2) + sizeof(ModelOutputLinesProb));
struct ModelOutputEdgessXY {
std::array<ModelOutputYZ, TRAJECTORY_SIZE> left;

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c67435e36760a0335154d784d880baf10f3be3c16dd9de53cf20a85d43813c17
size 76722695
oid sha256:ba3fe3e61853cc1434e3e220f40c8e9d1f1b9bab8458196ba3bea6a10b82c6ed
size 72718099

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a83fd5f6ce4bba18d18491341f916492414fa012552ecaa8bca3d1273292b0ec
size 77115165
oid sha256:bda57c1a66944f5a633ecd739a24d62702c717a234f2fdcc499dfa1d61c3c19e
size 73147489

@ -1 +1 @@
0c93e2e8951a249ebdae55bb49354d918b5e7f85
5fb5cd71a6e878cf45593ecea22c93e932f70c31
Loading…
Cancel
Save