Skip to content

Commit f82088c

Browse files
Rebase on new OpenVINO building method
1 parent ebf74d4 commit f82088c

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

.ci/scripts/test_yolo26.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
set -ex
99

10-
# NOTE: Run .ci/scripts/setup-openvino.sh before this script to download and
11-
# install OpenVINO when using the openvino backend.
12-
1310
# shellcheck source=/dev/null
1411
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
1512

@@ -79,10 +76,13 @@ if [[ "${MODE}" =~ .*openvino.* ]]; then
7976
OPENVINO=ON
8077
TARGET_LIBS="$TARGET_LIBS openvino_backend "
8178

82-
# Use existing openvino installation from the root directory
83-
# setup-openvino.sh extracts OpenVINO into openvino/
84-
source openvino/setupvars.sh
85-
pip install -r backends/openvino/requirements.txt
79+
# Install specific OpenVINO runtime from pip.
80+
$PYTHON_EXECUTABLE -m pip install --pre openvino==2026.1.0.dev20260131 --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
81+
$PYTHON_EXECUTABLE -m pip install -r backends/openvino/requirements.txt
82+
83+
# Set OPENVINO_LIB_PATH so the C++ demo runner can also find libopenvino_c.so.
84+
OPENVINO_LIB_PATH=$($PYTHON_EXECUTABLE -c "import openvino, os, glob; print(sorted(glob.glob(os.path.join(os.path.dirname(openvino.__file__), 'libs', 'libopenvino_c.so*')))[-1])")
85+
export OPENVINO_LIB_PATH
8686
else
8787
OPENVINO=OFF
8888
fi
@@ -96,9 +96,10 @@ fi
9696

9797
which "${PYTHON_EXECUTABLE}"
9898

99+
TORCH_URL=https://download.pytorch.org/whl/cpu
99100

100101
DIR="examples/models/yolo26"
101-
$PYTHON_EXECUTABLE -m pip install --upgrade-strategy only-if-needed -r ${DIR}/requirements.txt
102+
$PYTHON_EXECUTABLE -m pip install --upgrade-strategy only-if-needed --extra-index-url "$TORCH_URL" -r ${DIR}/requirements.txt
102103

103104
cmake_install_executorch_libraries() {
104105
rm -rf cmake-out
@@ -135,7 +136,7 @@ cmake_install_executorch_libraries() {
135136

136137
echo $TARGET_LIBS
137138
export CMAKE_BUILD_ARGS="--target $TARGET_LIBS"
138-
pip install . --no-build-isolation
139+
$PYTHON_EXECUTABLE -m pip install . --no-build-isolation
139140
}
140141

141142
cmake_build_demo() {

examples/models/yolo26/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ if(USE_XNNPACK_BACKEND)
4444
endif()
4545

4646
if(USE_OPENVINO_BACKEND)
47-
find_package(OpenVINO REQUIRED)
47+
# The OpenVINO backend resolves symbols via dlopen at runtime, so there is no
48+
# build-time dependency on the OpenVINO SDK (no find_package needed).
4849
list(APPEND link_libraries openvino_backend)
4950
executorch_target_link_options_shared_lib(openvino_backend)
5051
endif()

examples/models/yolo26/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To install ExecuTorch, follow this [guide](https://pytorch.org/executorch/stable
2323
The demo requires the `ultralytics` package, which depends on `torch` and `torchvision`. Since these packages are already installed as dev dependencies, use `--upgrade-strategy only-if-needed` to avoid version conflicts:
2424

2525
```bash
26-
python -m pip install --upgrade-strategy only-if-needed -r requirements.txt
26+
python -m pip install --upgrade-strategy only-if-needed --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
2727
```
2828

2929
### Step 4: Export the YOLO26 model to the ExecuTorch

0 commit comments

Comments
 (0)