Skip to content

Commit 33b7e8d

Browse files
Clean
1 parent d88ef3d commit 33b7e8d

File tree

6 files changed

+12
-17
lines changed

6 files changed

+12
-17
lines changed

backends/openvino/scripts/openvino_build.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,11 @@ main() {
2626
cmake -DCMAKE_INSTALL_PREFIX="${build_dir}" \
2727
-DCMAKE_BUILD_TYPE=Release \
2828
-DEXECUTORCH_BUILD_OPENVINO=ON \
29-
-DEXECUTORCH_BUILD_XNNPACK=ON \
3029
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
3130
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
3231
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
3332
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
3433
-DEXECUTORCH_BUILD_OPENVINO_EXECUTOR_RUNNER=ON \
35-
-DPYTHON_EXECUTABLE=python \
36-
-DEXECUTORCH_LOG_LEVEL=Debug \
3734
-B"${build_dir}"
3835

3936

@@ -51,14 +48,13 @@ main() {
5148
# Set parameters to configure the project with CMake
5249
# Note: Add any additional configuration options you need here
5350
export CMAKE_ARGS="-DEXECUTORCH_BUILD_OPENVINO=ON \
54-
-DEXECUTORCH_BUILD_XNNPACK=ON \
5551
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
5652
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
5753
-DEXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL=ON \
5854
-DEXECUTORCH_ENABLE_LOGGING=ON \
5955
-DEXECUTORCH_BUILD_EXTENSION_TENSOR=ON \
6056
-DEXECUTORCH_BUILD_PYBIND=ON"
61-
export CMAKE_BUILD_ARGS="--target openvino_backend xnnpack_backend"
57+
export CMAKE_BUILD_ARGS="--target openvino_backend"
6258

6359
# Build the package
6460
pip install . --no-build-isolation

examples/models/yolo12/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
22

33
project(Yolo12DetectionDemo VERSION 0.1)
44

5-
option(USE_OPENVINO_BACKEND "Build the tutorial with the XNNPACK backend" ON)
5+
option(USE_OPENVINO_BACKEND "Build the tutorial with the OPENVINO backend" ON)
66
option(USE_XNNPACK_BACKEND "Build the tutorial with the XNNPACK backend" OFF)
77

88
set(CMAKE_INCLUDE_CURRENT_DIR ON)

examples/models/yolo12/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
<p align="center">
44
<br>
5-
<img src="./yolo12s_demo.gif" width=300>
5+
<img src="./yolo12s_demo.gif">
66
<br>
77
</p>
88

9-
This example demonstrates how to perform inference of Ultralytics YOLO12 family detection models in C++ leveraging the Executorch backends:
9+
This example demonstrates how to perform inference of [Ultralytics YOLO12 family](https://docs.ultralytics.com/models/yolo12/) detection models in C++ leveraging the Executorch backends:
1010
- [OpenVINO](../../../backends/openvino/README.md)
1111
- [XNNPACK](../../../backends/xnnpack/README.md)
1212

@@ -86,5 +86,7 @@ To get a full parameters description please use the following command:
8686

8787

8888
# Credits:
89+
8990
Ultralytics examples: https://github.com/ultralytics/ultralytics/tree/main/examples
91+
9092
Sample video: https://www.pexels.com/@shanu-1040189/

examples/models/yolo12/build.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/models/yolo12/export_and_quantize.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
import executorch
1616
import numpy as np
1717
import torch
18-
from executorch.backends.openvino.partitioner import OpenvinoPartitioner
19-
from executorch.backends.openvino.quantizer import OpenVINOQuantizer
20-
from executorch.backends.openvino.quantizer.quantizer import QuantizationMode
2118
from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
2219
from executorch.backends.xnnpack.quantizer.xnnpack_quantizer import (
2320
get_symmetric_quantization_config,
@@ -80,7 +77,11 @@ def lower_to_openvino(
8077
subset_size: int,
8178
quantize: bool,
8279
) -> ExecutorchProgramManager:
80+
# Import openvino locally to avoid nncf side-effects
8381
import nncf.torch
82+
from executorch.backends.openvino.partitioner import OpenvinoPartitioner
83+
from executorch.backends.openvino.quantizer import OpenVINOQuantizer
84+
from executorch.backends.openvino.quantizer.quantizer import QuantizationMode
8485
from nncf.experimental.torch.fx import quantize_pt2e
8586

8687
with nncf.torch.disable_patching():

examples/models/yolo12/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ int main(int argc, char** argv) {
5757

5858
ET_CHECK_MSG(
5959
error == Error::Ok,
60-
"Loading of the model failed with status 0x%",
60+
"Loading of the model failed with status 0x%" PRIx32,
6161
(uint32_t)error);
6262
error = yolo_module.load_forward();
6363
ET_CHECK_MSG(
6464
error == Error::Ok,
65-
"Loading of the forward method failed with status 0x%",
65+
"Loading of the forward method failed with status 0x%" PRIx32,
6666
(uint32_t)error);
6767

6868
const auto model_input_shape =

0 commit comments

Comments
 (0)