log DM model execution time (#2589)
old-commit-hash: 580589b2507bf344cd692a47b52edf85fa7bd784
This commit is contained in:
2
cereal
2
cereal
Submodule cereal updated: 3da12dc835...3d09a7508f
@@ -65,7 +65,7 @@ int main(int argc, char **argv) {
|
||||
double t2 = millis_since_boot();
|
||||
|
||||
// send dm packet
|
||||
dmonitoring_publish(pm, extra.frame_id, res);
|
||||
dmonitoring_publish(pm, extra.frame_id, res, t2-t1);
|
||||
|
||||
LOGD("dmonitoring process: %.2fms, from last %.2fms", t2-t1, t1-last);
|
||||
last = t1;
|
||||
|
||||
@@ -165,11 +165,12 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res){
|
||||
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res, float execution_time){
|
||||
// make msg
|
||||
MessageBuilder msg;
|
||||
auto framed = msg.initEvent().initDriverState();
|
||||
framed.setFrameId(frame_id);
|
||||
framed.setModelExecutionTime(execution_time);
|
||||
|
||||
kj::ArrayPtr<const float> face_orientation(&res.face_orientation[0], ARRAYSIZE(res.face_orientation));
|
||||
kj::ArrayPtr<const float> face_orientation_std(&res.face_orientation_meta[0], ARRAYSIZE(res.face_orientation_meta));
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct DMonitoringModelState {
|
||||
|
||||
void dmonitoring_init(DMonitoringModelState* s);
|
||||
DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height);
|
||||
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res);
|
||||
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res, float execution_time);
|
||||
void dmonitoring_free(DMonitoringModelState* s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user