feat: cam and slience detect sleep

This commit is contained in:
0Xiao0
2026-06-17 15:02:16 +08:00
parent 154ce461d7
commit a8c6c62c92
9 changed files with 564 additions and 163 deletions

View File

@ -3,6 +3,13 @@
#include <string>
struct CameraDrowsinessResult {
bool valid = false;
bool eyes_closed = false;
float eye_openness_score = 0.0f;
float baseline_score = 0.0f;
};
class Camera {
public:
virtual void SetExplainUrl(const std::string& url, const std::string& token) = 0;
@ -10,6 +17,7 @@ public:
virtual bool SetHMirror(bool enabled) = 0;
virtual bool SetVFlip(bool enabled) = 0;
virtual bool SetSwapBytes(bool enabled) { return false; } // Optional, default no-op
virtual bool DetectDrowsiness(CameraDrowsinessResult& result, bool show_debug_preview = false) { return false; }
virtual std::string Explain(const std::string& question) = 0;
};