SHA256
38 lines
604 B
C++
38 lines
604 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace r1_voice {
|
|
|
|
struct VisionConfig {
|
|
std::string detections_path =
|
|
"/dev/shm/r1_detections.json";
|
|
|
|
// Reject YOLO output older than this.
|
|
double max_age_seconds = 2.5;
|
|
|
|
double min_confidence = 0.35;
|
|
};
|
|
|
|
class VisionContext {
|
|
public:
|
|
explicit VisionContext(
|
|
VisionConfig config
|
|
);
|
|
|
|
bool isVisionQuestion(
|
|
const std::string& text
|
|
) const;
|
|
|
|
std::string buildContext() const;
|
|
|
|
private:
|
|
VisionConfig config_;
|
|
|
|
static std::string lowerAscii(
|
|
std::string text
|
|
);
|
|
};
|
|
|
|
} // namespace r1_voice
|