Skip to content

Commit 995e341

Browse files
committed
always extra
1 parent 4e55590 commit 995e341

File tree

16 files changed

+41
-81
lines changed

16 files changed

+41
-81
lines changed

models/big_supercombo.dlc

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/big_supercombo.onnx

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/supercombo.dlc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:209e9544e456dbc2a7d60490da65154e129bc84830909d8d931f97b3df93949b
3-
size 56684955
2+
oid sha256:ba3fe3e61853cc1434e3e220f40c8e9d1f1b9bab8458196ba3bea6a10b82c6ed
3+
size 72718099

models/supercombo.onnx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:2365bae967cce21ce68707c30bf2981bb7081ee5c3e6a3dff793e660f23ff622
3-
size 57554657
2+
oid sha256:bda57c1a66944f5a633ecd739a24d62702c717a234f2fdcc499dfa1d61c3c19e
3+
size 73147489

release/files_common

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ common/transformations/transformations.pyx
5858
common/api/__init__.py
5959

6060
models/supercombo.dlc
61-
models/big_supercombo.dlc
6261
models/dmonitoring_model_q.dlc
6362

6463
release/*

selfdrive/modeld/SConscript

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ thneed_src = [
3131

3232
use_thneed = not GetOption('no_thneed')
3333

34-
use_extra = True # arch == "larch64"
35-
lenv['CXXFLAGS'].append('-DUSE_EXTRA=true' if use_extra else '-DUSE_EXTRA=false')
36-
3734
if arch == "aarch64" or arch == "larch64":
3835
libs += ['gsl', 'CB']
3936
libs += ['gnustl_shared'] if arch == "aarch64" else ['pthread', 'dl']
@@ -68,7 +65,7 @@ common_model = lenv.Object(common_src)
6865

6966
# build thneed model
7067
if use_thneed and arch in ("aarch64", "larch64"):
71-
fn = "../../models/big_supercombo" if use_extra else "../../models/supercombo"
68+
fn = "../../models/supercombo"
7269
compiler = lenv.Program('thneed/compile', ["thneed/compile.cc"]+common_model, LIBS=libs)
7370
cmd = f"cd {Dir('.').abspath} && {compiler[0].abspath} {fn}.dlc {fn}.thneed --binary"
7471

selfdrive/modeld/modeld.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mat3 update_calibration(Eigen::Matrix<float, 3, 4> &extrinsics, bool wide_camera
5151
return matmul3(yuv_transform, transform);
5252
}
5353

54-
void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcClient &vipc_client_extra, bool main_wide_camera, bool use_extra, bool use_extra_client) {
54+
void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcClient &vipc_client_extra, bool main_wide_camera, bool use_extra_client) {
5555
// messaging
5656
PubMaster pm({"modelV2", "cameraOdometry"});
5757
SubMaster sm({"lateralPlan", "roadCameraState", "liveCalibration"});
@@ -134,9 +134,7 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client_main, VisionIpcCl
134134
}
135135

136136
model_transform_main = update_calibration(extrinsic_matrix_eigen, main_wide_camera, false);
137-
if (use_extra) {
138-
model_transform_extra = update_calibration(extrinsic_matrix_eigen, Hardware::TICI(), true);
139-
}
137+
model_transform_extra = update_calibration(extrinsic_matrix_eigen, Hardware::TICI(), true);
140138
live_calib_seen = true;
141139
}
142140

@@ -181,16 +179,15 @@ int main(int argc, char **argv) {
181179
}
182180

183181
bool main_wide_camera = Hardware::TICI() ? Params().getBool("EnableWideCamera") : false;
184-
bool use_extra = USE_EXTRA;
185-
bool use_extra_client = Hardware::TICI() && use_extra && !main_wide_camera;
182+
bool use_extra_client = Hardware::TICI() && !main_wide_camera;
186183

187184
// cl init
188185
cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT);
189186
cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err));
190187

191188
// init the models
192189
ModelState model;
193-
model_init(&model, device_id, context, use_extra);
190+
model_init(&model, device_id, context);
194191
LOGW("models loaded, modeld starting");
195192

196193
VisionIpcClient vipc_client_main = VisionIpcClient("camerad", main_wide_camera ? VISION_STREAM_WIDE_ROAD : VISION_STREAM_ROAD, true, device_id, context);
@@ -215,7 +212,7 @@ int main(int argc, char **argv) {
215212
LOGW("connected extra cam with buffer size: %d (%d x %d)", wb->len, wb->width, wb->height);
216213
}
217214

218-
run_model(model, vipc_client_main, vipc_client_extra, main_wide_camera, use_extra, use_extra_client);
215+
run_model(model, vipc_client_main, vipc_client_extra, main_wide_camera, use_extra_client);
219216
}
220217

221218
model_free(&model);

selfdrive/modeld/models/driving.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ constexpr const kj::ArrayPtr<const T> to_kj_array_ptr(const std::array<T, size>
2626
return kj::ArrayPtr(arr.data(), arr.size());
2727
}
2828

29-
void model_init(ModelState* s, cl_device_id device_id, cl_context context, bool use_extra) {
29+
void model_init(ModelState* s, cl_device_id device_id, cl_context context) {
3030
s->frame = new ModelFrame(device_id, context);
3131
s->wide_frame = new ModelFrame(device_id, context);
3232

3333
#ifdef USE_THNEED
34-
s->m = std::make_unique<ThneedModel>(use_extra ? "../../models/big_supercombo.thneed" : "../../models/supercombo.thneed",
35-
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME, use_extra);
34+
s->m = std::make_unique<ThneedModel>("../../models/supercombo.thneed",
35+
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME);
3636
#elif USE_ONNX_MODEL
37-
s->m = std::make_unique<ONNXModel>(use_extra ? "../../models/big_supercombo.onnx" : "../../models/supercombo.onnx",
38-
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME, use_extra);
37+
s->m = std::make_unique<ONNXModel>("../../models/supercombo.onnx",
38+
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME);
3939
#else
40-
s->m = std::make_unique<SNPEModel>(use_extra ? "../../models/big_supercombo.dlc" : "../../models/supercombo.dlc",
41-
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME, use_extra);
40+
s->m = std::make_unique<SNPEModel>("../../models/supercombo.dlc",
41+
&s->output[0], NET_OUTPUT_SIZE, USE_GPU_RUNTIME);
4242
#endif
4343

4444
#ifdef TEMPORAL

selfdrive/modeld/models/driving.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ struct ModelState {
266266
#endif
267267
};
268268

269-
void model_init(ModelState* s, cl_device_id device_id, cl_context context, bool use_extra);
269+
void model_init(ModelState* s, cl_device_id device_id, cl_context context);
270270
ModelOutput *model_eval_frame(ModelState* s, VisionBuf* buf, VisionBuf* buf_wide,
271271
const mat3 &transform, const mat3 &transform_wide, float *desire_in);
272272
void model_free(ModelState* s);

selfdrive/modeld/runners/onnxmodel.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
#include "selfdrive/common/swaglog.h"
1515
#include "selfdrive/common/util.h"
1616

17-
ONNXModel::ONNXModel(const char *path, float *_output, size_t _output_size, int runtime, bool _use_extra) {
17+
ONNXModel::ONNXModel(const char *path, float *_output, size_t _output_size, int runtime) {
1818
LOGD("loading model %s", path);
1919

2020
output = _output;
2121
output_size = _output_size;
22-
use_extra = _use_extra;
2322

2423
int err = pipe(pipein);
2524
assert(err == 0);

0 commit comments

Comments
 (0)