mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-23 09:13:43 +08:00
02f0f39b52
* get log * simplify two nonsense * not needed * libyuv is a joke * clean up * try small * fast but not bad * working * clean up driverview * simplified * thats mirrored * smol * tweak * ref is screen * w/ ee * update camera model * no if TICI * start * update pose thresh * less cpu more dsp * new libyuv * new snpe * add files * test * should be fast * update out len * trigger test * use master snpe * add cereal * update cereal * refactor parsing * missing ; * get * wrong type * test model * use driver data * 10829278-72fe-4283-a118-2cef959ce174/1550 * no pf * adapt driverview * ; * rhd learner * update libyuv buildi x64 * ad4337ea * remove blink slack * test * no * use toggle * b16 * fix for nv12 * 5b02cff5 both * update test * update cereal * update cereal * update cereal * v2 packets * revert libyuv * no / * update snpemodel * ; * memcpy * fix test * use toggle in driverview * update power * update replay * Revert "update replay" This reverts commit 1d0979ca59dbc89bc5890656e9501e83f0556d50. * update model ref * halve cpu * fake 8bit onnx runner * same thresh as report * cereal master Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: d6c07a6b158595c1ab10256dc6eee4fbdf902379
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "cereal/messaging/messaging.h"
|
|
#include "common/util.h"
|
|
#include "selfdrive/modeld/models/commonmodel.h"
|
|
#include "selfdrive/modeld/runners/run.h"
|
|
|
|
#define CALIB_LEN 3
|
|
|
|
#define OUTPUT_SIZE 84
|
|
#define REG_SCALE 0.25f
|
|
|
|
typedef struct DriverStateResult {
|
|
float face_orientation[3];
|
|
float face_orientation_std[3];
|
|
float face_position[2];
|
|
float face_position_std[2];
|
|
float face_prob;
|
|
float left_eye_prob;
|
|
float right_eye_prob;
|
|
float left_blink_prob;
|
|
float right_blink_prob;
|
|
float sunglasses_prob;
|
|
float occluded_prob;
|
|
float ready_prob[4];
|
|
float not_ready_prob[2];
|
|
} DriverStateResult;
|
|
|
|
typedef struct DMonitoringModelResult {
|
|
DriverStateResult driver_state_lhd;
|
|
DriverStateResult driver_state_rhd;
|
|
float poor_vision_prob;
|
|
float wheel_on_right_prob;
|
|
float dsp_execution_time;
|
|
} DMonitoringModelResult;
|
|
|
|
typedef struct DMonitoringModelState {
|
|
RunModel *m;
|
|
bool is_rhd;
|
|
float output[OUTPUT_SIZE];
|
|
std::vector<uint8_t> net_input_buf;
|
|
float calib[CALIB_LEN];
|
|
} DMonitoringModelState;
|
|
|
|
void dmonitoring_init(DMonitoringModelState* s);
|
|
DMonitoringModelResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_buf, int width, int height, int stride, int uv_offset, float *calib);
|
|
void dmonitoring_publish(PubMaster &pm, uint32_t frame_id, const DMonitoringModelResult &model_res, float execution_time, kj::ArrayPtr<const float> raw_pred);
|
|
void dmonitoring_free(DMonitoringModelState* s);
|
|
|