move models to selfdrive/modeld/ (#24539)

* move models to selfdrive/modeld/

* two more refs
pull/24542/head
Adeeb Shihadeh 3 years ago committed by GitHub
parent 81dacbedca
commit 319f3d1475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      release/build_release.sh
  2. 5
      release/files_common
  3. 2
      selfdrive/modeld/SConscript
  4. 0
      selfdrive/modeld/models/README.md
  5. 4
      selfdrive/modeld/models/dmonitoring.cc
  6. 0
      selfdrive/modeld/models/dmonitoring_model.current
  7. 0
      selfdrive/modeld/models/dmonitoring_model.onnx
  8. 0
      selfdrive/modeld/models/dmonitoring_model_q.dlc
  9. 6
      selfdrive/modeld/models/driving.cc
  10. 0
      selfdrive/modeld/models/supercombo.dlc
  11. 0
      selfdrive/modeld/models/supercombo.onnx
  12. 7
      selfdrive/modeld/thneed/weights_fixup.py
  13. 1
      tools/sim/Dockerfile.sim

@ -76,7 +76,7 @@ find . -name 'moc_*' -delete
find . -name '__pycache__' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
rm models/supercombo.dlc
rm selfdrive/modeld/models/supercombo.dlc
# Move back signed panda fw
mkdir -p panda/board/obj

@ -56,9 +56,6 @@ common/transformations/transformations.pyx
common/api/__init__.py
models/supercombo.dlc
models/dmonitoring_model_q.dlc
release/*
tools/lib/*
@ -340,6 +337,8 @@ selfdrive/modeld/models/driving.cc
selfdrive/modeld/models/driving.h
selfdrive/modeld/models/dmonitoring.cc
selfdrive/modeld/models/dmonitoring.h
selfdrive/modeld/models/supercombo.dlc
selfdrive/modeld/models/dmonitoring_model_q.dlc
selfdrive/modeld/transforms/loadyuv.cc
selfdrive/modeld/transforms/loadyuv.h

@ -63,7 +63,7 @@ common_model = lenv.Object(common_src)
# build thneed model
if use_thneed and arch == "larch64":
fn = File("#models/supercombo").abspath
fn = File("models/supercombo").abspath
compiler = lenv.Program('thneed/compile', ["thneed/compile.cc"]+common_model, LIBS=libs)
cmd = f"cd {Dir('.').abspath} && {compiler[0].abspath} {fn}.dlc {fn}_badweights.thneed --binary"

@ -39,9 +39,9 @@ void dmonitoring_init(DMonitoringModelState* s) {
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);
s->m = new ONNXModel("models/dmonitoring_model.onnx", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME);
#else
s->m = new SNPEModel("../../models/dmonitoring_model_q.dlc", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME);
s->m = new SNPEModel("models/dmonitoring_model_q.dlc", &s->output[0], OUTPUT_SIZE, USE_DSP_RUNTIME);
#endif
s->m->addCalib(s->calib, CALIB_LEN);

@ -32,11 +32,11 @@ void model_init(ModelState* s, cl_device_id device_id, cl_context context) {
s->wide_frame = new ModelFrame(device_id, context);
#ifdef USE_THNEED
s->m = std::make_unique<ThneedModel>("../../models/supercombo.thneed",
s->m = std::make_unique<ThneedModel>("models/supercombo.thneed",
#elif USE_ONNX_MODEL
s->m = std::make_unique<ONNXModel>("../../models/supercombo.onnx",
s->m = std::make_unique<ONNXModel>("models/supercombo.onnx",
#else
s->m = std::make_unique<SNPEModel>("../../models/supercombo.dlc",
s->m = std::make_unique<SNPEModel>("models/supercombo.dlc",
#endif
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME, true);

@ -140,6 +140,7 @@ def weights_fixup(target, source_thneed, dlc):
save_thneed(jdat, target)
if __name__ == "__main__":
weights_fixup(os.path.join(BASEDIR, "models/supercombo_fixed.thneed"),
os.path.join(BASEDIR, "models/supercombo.thneed"),
os.path.join(BASEDIR, "models/supercombo.dlc"))
model_dir = os.path.join(BASEDIR, "selfdrive/modeld/models/")
weights_fixup(os.path.join(model_dir, "supercombo_fixed.thneed"),
os.path.join(model_dir, "supercombo.thneed"),
os.path.join(model_dir, "supercombo.dlc"))

@ -50,7 +50,6 @@ COPY ./pyextra $HOME/openpilot/pyextra
COPY ./site_scons $HOME/openpilot/site_scons
COPY ./rednose $HOME/openpilot/rednose
COPY ./common $HOME/openpilot/common
COPY ./models $HOME/openpilot/models
COPY ./opendbc $HOME/openpilot/opendbc
COPY ./cereal $HOME/openpilot/cereal
COPY ./panda $HOME/openpilot/panda

Loading…
Cancel
Save