add open-vocab YOLO-World engine with CLIP text encoder
- Add OpenVocab engine: YOLO-World ONNX detection with runtime vocabulary via CLIP text embeddings (two-input model support) - Add header-only C++ CLIP BPE tokenizer (no external deps) - Add detect(cv::Mat) overload to OpenVocab for camera-free testing - Add standalone test binary (test_open_vocab) using test/assets images - Add export scripts for YOLO-World and CLIP text encoder (uv/PEP 723) - Add installation scripts for Linux x64, ARM (Jetson), and Windows - Update CMakeLists to use find_package(onnxruntime) instead of FetchContent - Update README and AGENTS with env vars, setup workflow, and test usage
This commit is contained in:
Executable
+75
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install build dependencies for dora-zed on NVIDIA Jetson (ARM64 / L4T).
|
||||
# Skips any component that is already installed.
|
||||
# Uses aria2c for fast parallel downloads if available, otherwise falls back to wget.
|
||||
#
|
||||
# Supported JetPack versions for ZED SDK 5.x:
|
||||
# JetPack 6.0 GA (L4T 36.3) — Jetson Orin
|
||||
# JetPack 6.1/6.2 (L4T 36.4)
|
||||
# JetPack 6.2.2 (L4T 36.5)
|
||||
# JetPack 7.0 (L4T 38.2) — Jetson Thor
|
||||
# JetPack 7.1 (L4T 38.4)
|
||||
#
|
||||
# ONNX Runtime: Microsoft does not publish official GPU binaries for ARM64.
|
||||
# The native engine (ZED SDK built-in TensorRT) works without ONNX Runtime.
|
||||
# To use the open_vocab engine, build ONNX Runtime from source:
|
||||
# https://onnxruntime.ai/docs/build/eps.html#tensorrt
|
||||
set -euo pipefail
|
||||
|
||||
ZED_VERSION="5.2"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
TMP_DIR="${SCRIPT_DIR}/../tmp"
|
||||
mkdir -p "$TMP_DIR"
|
||||
|
||||
download() {
|
||||
local url="$1" dest="$2"
|
||||
if command -v aria2c &>/dev/null; then
|
||||
aria2c -x 16 -s 16 -d "$(dirname "$dest")" -o "$(basename "$dest")" "$url"
|
||||
else
|
||||
wget -O "$dest" "$url"
|
||||
fi
|
||||
}
|
||||
|
||||
# --- Detect L4T version ---
|
||||
if [ ! -f /etc/nv_tegra_release ]; then
|
||||
echo "Error: /etc/nv_tegra_release not found. Is this a Jetson device?" >&2
|
||||
exit 1
|
||||
fi
|
||||
L4T_VERSION=$(head -1 /etc/nv_tegra_release | grep -oP 'R\K[0-9]+\.[0-9]+' | head -1)
|
||||
L4T_MAJOR=$(echo "$L4T_VERSION" | cut -d'.' -f1)
|
||||
echo ">>> Detected L4T ${L4T_VERSION} (major: ${L4T_MAJOR})"
|
||||
|
||||
case "$L4T_MAJOR" in
|
||||
36) L4T_PATH="l4t36" ;;
|
||||
38) L4T_PATH="l4t38" ;;
|
||||
35) L4T_PATH="l4t35" ;;
|
||||
*)
|
||||
echo "Warning: L4T ${L4T_MAJOR} not tested. Attempting l4t${L4T_MAJOR}." >&2
|
||||
L4T_PATH="l4t${L4T_MAJOR}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# --- ZED SDK ---
|
||||
if [ -d /usr/local/zed ]; then
|
||||
echo ">>> ZED SDK already installed at /usr/local/zed — skipping."
|
||||
else
|
||||
echo ">>> Downloading ZED SDK ${ZED_VERSION} for Jetson (${L4T_PATH})..."
|
||||
download \
|
||||
"https://download.stereolabs.com/zedsdk/${ZED_VERSION}/${L4T_PATH}/jetsons" \
|
||||
"${TMP_DIR}/ZED_SDK.run"
|
||||
chmod +x "${TMP_DIR}/ZED_SDK.run"
|
||||
echo ">>> Installing ZED SDK (silent)..."
|
||||
sudo "${TMP_DIR}/ZED_SDK.run" -- silent skip_python skip_tools
|
||||
fi
|
||||
|
||||
# --- ONNX Runtime ---
|
||||
echo ""
|
||||
echo ">>> ONNX Runtime (ARM64 GPU): no official pre-built binary available."
|
||||
echo " The native ZED engine works without ONNX Runtime."
|
||||
echo " To use the open_vocab engine, build from source:"
|
||||
echo " https://onnxruntime.ai/docs/build/eps.html#tensorrt"
|
||||
echo ""
|
||||
|
||||
echo ">>> Done. You can now run: mkdir -p build && cd build && cmake .. && make install"
|
||||
echo ">>> Downloaded files are in ${TMP_DIR}"
|
||||
Reference in New Issue
Block a user