The open_vocab engine now accepts an update_vocabulary input event carrying a UTF-8 comma-separated label string. Labels are re-encoded immediately via the CLIP text encoder; the next tick uses the new vocabulary. ZedNative ignores the input via a no-op base class method.
29 lines
706 B
C++
29 lines
706 B
C++
#pragma once
|
||
|
||
#include <sl/Camera.hpp>
|
||
#include <string>
|
||
#include <vector>
|
||
|
||
namespace engines {
|
||
|
||
struct DetectedObject {
|
||
int label_id;
|
||
float confidence;
|
||
float position[3]; // center x, y, z (mm)
|
||
float bounding_box_2d[8]; // 4 corners × 2 coords (pixels)
|
||
float bounding_box_3d[24]; // 8 corners × 3 coords (mm)
|
||
};
|
||
|
||
class Engine {
|
||
public:
|
||
virtual ~Engine() = default;
|
||
|
||
virtual void enable(sl::Camera& camera) = 0;
|
||
virtual void detect(sl::Camera& camera) = 0;
|
||
virtual void set_labels(const std::string& /*labels*/) {}
|
||
virtual const std::vector<DetectedObject>& objects() const = 0;
|
||
virtual std::string label_names() const = 0;
|
||
};
|
||
|
||
} // namespace engines
|