From d6ae0f7fefc072ccbfa327141ac41050390c6fe9 Mon Sep 17 00:00:00 2001 From: Cristhian Date: Mon, 7 Sep 2026 14:29:52 -0300 Subject: [PATCH] remove dead split_labels helper Its only caller was the deleted yoloworld_onnx.cc. --- AGENTS.md | 2 +- src/engines/yolo_helpers.h | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1c1ae00..298b6e6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,7 +34,7 @@ Camera and detection behavior is configured entirely through environment variabl - **`src/zed/camera.cc`** — Implementation. SDK enum parsers live in an anonymous namespace. - **`src/engines/engine.h`** — `engines::DetectedObject` struct and `engines::Engine` abstract base class (`enable`, `detect`, `objects`, `label_names`). - **`src/engines/zed_native.h/cc`** — `engines::ZedNative`: wraps ZED SDK's TensorRT-optimized object detection module. -- **`src/engines/yolo_helpers.h`** — Header-only shared helpers used by the ONNX engine: `RawDetection`, `nms()`, `letterbox()`, `fuse_bbox()`, `backproject()`, `split_labels()`. Lives in `engines::detail` namespace. +- **`src/engines/yolo_helpers.h`** — Header-only shared helpers used by the ONNX engine: `RawDetection`, `nms()`, `letterbox()`, `fuse_bbox()`, `backproject()`. Lives in `engines::detail` namespace. - **`src/engines/yolo_onnx.h/cc`** — `engines::YoloOnnx` / `YoloOnnxConfig`: closed-vocabulary detection for any single-input YOLO ONNX model (YOLOv8, YOLOv11, YOLOv5, etc.). Auto-detects output layout (`NC_FIRST` / `NC_LAST` / `NC_LAST_OBJ`) from tensor shape; override with `ZED_ONNX_OUTPUT_FORMAT`. Labels loaded from `ZED_ONNX_LABELS` or `ZED_ONNX_LABELS_FILE`. - **`src/main.cc`** — Dora event loop. Selects engine via `ZED_ENGINE` env var (`yolo_onnx`/`onnx` or `native`), holds a `std::unique_ptr`. Parses `ZED_PC_MODE` (`FULL`/`HALF`/`ROI`) once before the loop. On `tick` input: calls `camera.grab()` and `detector->detect()`, then sends `image_bgr`, `point_cloud`, `camera_info`, and `objects` outputs. Point cloud output varies by mode: `FULL` sends the raw `sl::Mat` pointer (no copy); `HALF` downsamples by 2 in each dimension; `ROI` emits only valid points within detected bounding boxes as a flat `[N, 4]` array. Handles reconnection on grab failure. - **`DoraTargets.cmake`** — Handles building or fetching dora-rs and generating the CXX bridge files. Two paths: local (`DORA_ROOT_DIR`) or git clone. Produces `dora_node_api_cxx` library and the `node_bridge.cc` glue. diff --git a/src/engines/yolo_helpers.h b/src/engines/yolo_helpers.h index 85eb673..1f4645e 100644 --- a/src/engines/yolo_helpers.h +++ b/src/engines/yolo_helpers.h @@ -5,8 +5,6 @@ #include #include -#include -#include #include namespace engines::detail { @@ -135,19 +133,4 @@ inline void backproject(float u, float v, float z, Y = (v - cy) * z / fy; } -// --- Label parsing --- - -inline std::vector split_labels(const std::string& s) { - std::vector out; - std::stringstream ss(s); - std::string tok; - while (std::getline(ss, tok, ',')) { - size_t l = tok.find_first_not_of(" \t"); - size_t r = tok.find_last_not_of(" \t"); - if (l != std::string::npos) - out.push_back(tok.substr(l, r - l + 1)); - } - return out; -} - } // namespace engines::detail