refactor open_vocab into yolo_onnx and yoloworld_onnx engines

Split the monolithic open_vocab engine into two focused engines:
yolo_onnx (closed-vocabulary, any single-input YOLO ONNX) and
yoloworld_onnx (open-vocabulary YOLO-World with CLIP encoder).
Shared NMS/letterbox/fuse helpers extracted to yolo_helpers.h.
Add export_yolo.py script and separate test binaries for each engine.
This commit is contained in:
cristhian aguilera
2026-03-30 04:44:25 -03:00
parent 748b0c3665
commit 44eec29b83
14 changed files with 1467 additions and 825 deletions
+8 -4
View File
@@ -1,5 +1,6 @@
#include "engines/engine.h"
#include "engines/open_vocab.h"
#include "engines/yolo_onnx.h"
#include "engines/yoloworld_onnx.h"
#include "engines/zed_native.h"
#include "util/env.h"
#include "zed/camera.h"
@@ -74,9 +75,12 @@ int main() {
std::string engine_name = util::get_env_str("ZED_ENGINE", "native");
std::unique_ptr<engines::Engine> detector;
if (engine_name == "open_vocab") {
auto cfg = engines::OpenVocabConfig::from_env();
detector = std::make_unique<engines::OpenVocab>(cfg);
if (engine_name == "yolo_onnx" || engine_name == "onnx") {
auto cfg = engines::YoloOnnxConfig::from_env();
detector = std::make_unique<engines::YoloOnnx>(cfg);
} else if (engine_name == "yoloworld_onnx" || engine_name == "open_vocab") {
auto cfg = engines::YoloWorldOnnxConfig::from_env();
detector = std::make_unique<engines::YoloWorldOnnx>(cfg);
} else {
auto cfg = engines::DetectionConfig::from_env();
detector = std::make_unique<engines::ZedNative>(cfg);