Revert "EfficientNet driver monitoring (#1866)"
This reverts commit 2d0e994674
.
Need to fix test
pull/1894/head
parent
2d0e994674
commit
c2be31c10b
|
@ -1 +1 @@
|
||||||
e96f9be6-5741-42ea-bdcd-0be6515b4230
|
43221d85-46fd-40b9-bff0-2b1b18a86b07
|
BIN
models/dmonitoring_model.keras (Stored with Git LFS)
BIN
models/dmonitoring_model.keras (Stored with Git LFS)
Binary file not shown.
BIN
models/dmonitoring_model_q.dlc (Stored with Git LFS)
BIN
models/dmonitoring_model_q.dlc (Stored with Git LFS)
Binary file not shown.
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#include <libyuv.h>
|
#include <libyuv.h>
|
||||||
|
|
||||||
#define MODEL_WIDTH 320
|
#define MODEL_WIDTH 160
|
||||||
#define MODEL_HEIGHT 640
|
#define MODEL_HEIGHT 320
|
||||||
#define FULL_W 852
|
#define FULL_W 426
|
||||||
|
|
||||||
#if defined(QCOM) || defined(QCOM2)
|
#if defined(QCOM) || defined(QCOM2)
|
||||||
#define input_lambda(x) (x - 128.f) * 0.0078125f
|
#define input_lambda(x) (x - 128.f) * 0.0078125f
|
||||||
|
@ -136,7 +136,6 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_
|
||||||
memcpy(&ret.right_eye_prob, &s->output[30], sizeof ret.right_eye_prob);
|
memcpy(&ret.right_eye_prob, &s->output[30], sizeof ret.right_eye_prob);
|
||||||
memcpy(&ret.left_blink_prob, &s->output[31], sizeof ret.right_eye_prob);
|
memcpy(&ret.left_blink_prob, &s->output[31], sizeof ret.right_eye_prob);
|
||||||
memcpy(&ret.right_blink_prob, &s->output[32], sizeof ret.right_eye_prob);
|
memcpy(&ret.right_blink_prob, &s->output[32], sizeof ret.right_eye_prob);
|
||||||
memcpy(&ret.sg_prob, &s->output[33], sizeof ret.sg_prob);
|
|
||||||
ret.face_orientation_meta[0] = softplus(ret.face_orientation_meta[0]);
|
ret.face_orientation_meta[0] = softplus(ret.face_orientation_meta[0]);
|
||||||
ret.face_orientation_meta[1] = softplus(ret.face_orientation_meta[1]);
|
ret.face_orientation_meta[1] = softplus(ret.face_orientation_meta[1]);
|
||||||
ret.face_orientation_meta[2] = softplus(ret.face_orientation_meta[2]);
|
ret.face_orientation_meta[2] = softplus(ret.face_orientation_meta[2]);
|
||||||
|
@ -167,7 +166,6 @@ void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringResu
|
||||||
framed.setRightEyeProb(res.right_eye_prob);
|
framed.setRightEyeProb(res.right_eye_prob);
|
||||||
framed.setLeftBlinkProb(res.left_blink_prob);
|
framed.setLeftBlinkProb(res.left_blink_prob);
|
||||||
framed.setRightBlinkProb(res.right_blink_prob);
|
framed.setRightBlinkProb(res.right_blink_prob);
|
||||||
framed.setSgProb(res.sg_prob);
|
|
||||||
|
|
||||||
pm.send("driverState", msg);
|
pm.send("driverState", msg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OUTPUT_SIZE 34
|
#define OUTPUT_SIZE 33
|
||||||
#define RHD_CHECK_INTERVAL 10
|
#define RHD_CHECK_INTERVAL 10
|
||||||
|
|
||||||
typedef struct DMonitoringResult {
|
typedef struct DMonitoringResult {
|
||||||
|
@ -22,7 +22,6 @@ typedef struct DMonitoringResult {
|
||||||
float right_eye_prob;
|
float right_eye_prob;
|
||||||
float left_blink_prob;
|
float left_blink_prob;
|
||||||
float right_blink_prob;
|
float right_blink_prob;
|
||||||
float sg_prob;
|
|
||||||
} DMonitoringResult;
|
} DMonitoringResult;
|
||||||
|
|
||||||
typedef struct DMonitoringModelState {
|
typedef struct DMonitoringModelState {
|
||||||
|
|
|
@ -21,9 +21,8 @@ _DISTRACTED_TIME = 11.
|
||||||
_DISTRACTED_PRE_TIME_TILL_TERMINAL = 8.
|
_DISTRACTED_PRE_TIME_TILL_TERMINAL = 8.
|
||||||
_DISTRACTED_PROMPT_TIME_TILL_TERMINAL = 6.
|
_DISTRACTED_PROMPT_TIME_TILL_TERMINAL = 6.
|
||||||
|
|
||||||
_FACE_THRESHOLD = 0.6
|
_FACE_THRESHOLD = 0.4
|
||||||
_EYE_THRESHOLD = 0.6
|
_EYE_THRESHOLD = 0.6
|
||||||
_SG_THRESHOLD = 0.5
|
|
||||||
_BLINK_THRESHOLD = 0.5 # 0.225
|
_BLINK_THRESHOLD = 0.5 # 0.225
|
||||||
_BLINK_THRESHOLD_SLACK = 0.65
|
_BLINK_THRESHOLD_SLACK = 0.65
|
||||||
_BLINK_THRESHOLD_STRICT = 0.5
|
_BLINK_THRESHOLD_STRICT = 0.5
|
||||||
|
@ -190,8 +189,8 @@ class DriverStatus():
|
||||||
# self.pose.roll_std = driver_state.faceOrientationStd[2]
|
# self.pose.roll_std = driver_state.faceOrientationStd[2]
|
||||||
model_std_max = max(self.pose.pitch_std, self.pose.yaw_std)
|
model_std_max = max(self.pose.pitch_std, self.pose.yaw_std)
|
||||||
self.pose.low_std = model_std_max < _POSESTD_THRESHOLD
|
self.pose.low_std = model_std_max < _POSESTD_THRESHOLD
|
||||||
self.blink.left_blink = driver_state.leftBlinkProb * (driver_state.leftEyeProb > _EYE_THRESHOLD) * (driver_state.sgProb < _SG_THRESHOLD)
|
self.blink.left_blink = driver_state.leftBlinkProb * (driver_state.leftEyeProb > _EYE_THRESHOLD)
|
||||||
self.blink.right_blink = driver_state.rightBlinkProb * (driver_state.rightEyeProb > _EYE_THRESHOLD) * (driver_state.sgProb < _SG_THRESHOLD)
|
self.blink.right_blink = driver_state.rightBlinkProb * (driver_state.rightEyeProb > _EYE_THRESHOLD)
|
||||||
self.face_detected = driver_state.faceProb > _FACE_THRESHOLD and \
|
self.face_detected = driver_state.faceProb > _FACE_THRESHOLD and \
|
||||||
abs(driver_state.facePosition[0]) <= 0.4 and abs(driver_state.facePosition[1]) <= 0.45
|
abs(driver_state.facePosition[0]) <= 0.4 and abs(driver_state.facePosition[1]) <= 0.45
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ class fake_DM_msg():
|
||||||
self.rightBlinkProb = 1. * is_distracted
|
self.rightBlinkProb = 1. * is_distracted
|
||||||
self.faceOrientationStd = [1.*is_model_uncertain, 1.*is_model_uncertain, 1.*is_model_uncertain]
|
self.faceOrientationStd = [1.*is_model_uncertain, 1.*is_model_uncertain, 1.*is_model_uncertain]
|
||||||
self.facePositionStd = [1.*is_model_uncertain, 1.*is_model_uncertain]
|
self.facePositionStd = [1.*is_model_uncertain, 1.*is_model_uncertain]
|
||||||
self.sgProb = 0.
|
|
||||||
|
|
||||||
|
|
||||||
# driver state from neural net, 10Hz
|
# driver state from neural net, 10Hz
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
6d58be2d98e689d0c23d5210bd32394d506e66f8
|
d0b7760731f1e310c7770dafee215ed2dee0d92d
|
Loading…
Reference in New Issue