move models to selfdrive/modeld/ (#24539)

* move models to selfdrive/modeld/

* two more refs
old-commit-hash: 319f3d1475f2f212b63f32dbace476f63b3caf14
This commit is contained in:
Adeeb Shihadeh
2022-05-15 17:29:09 -07:00
committed by GitHub
parent fb1c3b0d5d
commit 39de4d80b4
13 changed files with 13 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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);

View File

@@ -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);

View File

@@ -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"))

View File

@@ -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