parent
d25cc6f624
commit
b3fd759fe8
2
cereal
2
cereal
|
@ -1 +1 @@
|
|||
Subproject commit 15c431a3d64f6b413f500bd2a0b145ed2a0149b5
|
||||
Subproject commit 6da2062b1c521e4d5ae4384055984cf423df1f4b
|
|
@ -160,7 +160,9 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_
|
|||
//fwrite(net_input_buf, MODEL_HEIGHT*MODEL_WIDTH*3/2, sizeof(float), dump_yuv_file2);
|
||||
//fclose(dump_yuv_file2);
|
||||
|
||||
double t1 = millis_since_boot();
|
||||
s->m->execute(net_input_buf, yuv_buf_len);
|
||||
double t2 = millis_since_boot();
|
||||
|
||||
DMonitoringResult ret = {0};
|
||||
memcpy(&ret.face_orientation, &s->output[0], sizeof ret.face_orientation);
|
||||
|
@ -178,6 +180,7 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_
|
|||
ret.face_orientation_meta[2] = softplus(ret.face_orientation_meta[2]);
|
||||
ret.face_position_meta[0] = softplus(ret.face_position_meta[0]);
|
||||
ret.face_position_meta[1] = softplus(ret.face_position_meta[1]);
|
||||
ret.dsp_execution_time = (t2 - t1) / 1000.;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -187,6 +190,7 @@ void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResu
|
|||
auto framed = msg.initEvent().initDriverState();
|
||||
framed.setFrameId(frame_id);
|
||||
framed.setModelExecutionTime(execution_time);
|
||||
framed.setDspExecutionTime(res.dsp_execution_time);
|
||||
|
||||
framed.setFaceOrientation(res.face_orientation);
|
||||
framed.setFaceOrientationStd(res.face_orientation_meta);
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
#include "runners/run.h"
|
||||
#include "messaging.hpp"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OUTPUT_SIZE 34
|
||||
|
||||
typedef struct DMonitoringResult {
|
||||
|
@ -22,6 +18,7 @@ typedef struct DMonitoringResult {
|
|||
float left_blink_prob;
|
||||
float right_blink_prob;
|
||||
float sg_prob;
|
||||
float dsp_execution_time;
|
||||
} DMonitoringResult;
|
||||
|
||||
typedef struct DMonitoringModelState {
|
||||
|
@ -40,7 +37,3 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_
|
|||
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResult &res, const float* raw_pred, float execution_time);
|
||||
void dmonitoring_free(DMonitoringModelState* s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue