Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions .ci/scripts/test_yolo12.sh → .ci/scripts/test_yolo26.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# LICENSE file in the root directory of this source tree.

set -ex

# shellcheck source=/dev/null
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"

Expand Down Expand Up @@ -50,21 +51,21 @@ PT2E_QUANTIZE="${PT2E_QUANTIZE:-}"
# Default CMake Build Type to release mode
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Release}

if [[ $# -lt 5 ]]; then # Assuming 4 mandatory args
echo "Expecting atleast 5 positional arguments"
echo "Usage: [...]"
fi
if [[ -z "${MODEL_NAME:-}" ]]; then
echo "Missing model name, exiting..."
exit 1
fi


if [[ -z "${MODE:-}" ]]; then
echo "Missing mode, choose openvino or xnnpack, exiting..."
exit 1
fi

if [[ -z "${VIDEO_PATH:-}" ]]; then
echo "Missing video path, exiting..."
exit 1
fi

if [[ -z "${PYTHON_EXECUTABLE:-}" ]]; then
PYTHON_EXECUTABLE=python3
fi
Expand All @@ -75,21 +76,13 @@ if [[ "${MODE}" =~ .*openvino.* ]]; then
OPENVINO=ON
TARGET_LIBS="$TARGET_LIBS openvino_backend "

git clone https://github.com/openvinotoolkit/openvino.git
cd openvino && git b16b776ac119dafda51f69a80f1e6b7376d02c3b
git submodule update --init --recursive
sudo ./install_build_dependencies.sh
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_PYTHON=ON
make -j$(nproc)

cd ..
cmake --install build --prefix dist

source dist/setupvars.sh
cd ../backends/openvino
pip install -r requirements.txt
cd ../../
# Install specific OpenVINO runtime from pip.
$PYTHON_EXECUTABLE -m pip install --pre openvino==2026.1.0.dev20260131 --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
$PYTHON_EXECUTABLE -m pip install -r backends/openvino/requirements.txt

# Set OPENVINO_LIB_PATH so the C++ demo runner can also find libopenvino_c.so.
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])")
export OPENVINO_LIB_PATH
else
OPENVINO=OFF
fi
Expand All @@ -103,9 +96,10 @@ fi

which "${PYTHON_EXECUTABLE}"

TORCH_URL=https://download.pytorch.org/whl/cpu

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

cmake_install_executorch_libraries() {
rm -rf cmake-out
Expand Down Expand Up @@ -142,11 +136,11 @@ cmake_install_executorch_libraries() {

echo $TARGET_LIBS
export CMAKE_BUILD_ARGS="--target $TARGET_LIBS"
pip install . --no-build-isolation
$PYTHON_EXECUTABLE -m pip install . --no-build-isolation
}

cmake_build_demo() {
echo "Building yolo12 runner"
echo "Building yolo26 runner"
retry cmake \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DUSE_OPENVINO_BACKEND="$OPENVINO" \
Expand Down Expand Up @@ -174,24 +168,29 @@ prepare_artifacts_upload() {


# Export model.
EXPORTED_MODEL_NAME="${MODEL_NAME}_fp32_${MODE}.pte"
echo "Exporting ${EXPORTED_MODEL_NAME}"
EXPORT_ARGS="--model_name=${MODEL_NAME} --backend=${MODE}"
if [[ -n "${PT2E_QUANTIZE}" ]]; then
EXPORTED_MODEL_NAME="${MODEL_NAME}_int8_${MODE}.pte"
EXPORT_ARGS="${EXPORT_ARGS} --quantize --video_path=${VIDEO_PATH}"
else
EXPORTED_MODEL_NAME="${MODEL_NAME}_fp32_${MODE}.pte"
fi
echo "Exporting ${EXPORTED_MODEL_NAME}"

# Add dynamically linked library location
cmake_install_executorch_libraries

$PYTHON_EXECUTABLE -m examples.models.yolo12.export_and_validate ${EXPORT_ARGS}
$PYTHON_EXECUTABLE -m examples.models.yolo26.export_and_validate ${EXPORT_ARGS}


RUNTIME_ARGS="--model_path=${EXPORTED_MODEL_NAME} --input_path=${VIDEO_PATH}"
# Check build tool.
cmake_build_demo
# Run yolo12 runner
# Run yolo26 runner
NOW=$(date +"%H:%M:%S")
echo "Starting to run yolo12 runner at ${NOW}"
echo "Starting to run yolo26 runner at ${NOW}"
# shellcheck source=/dev/null
cmake-out/examples/models/yolo12/Yolo12DetectionDemo ${RUNTIME_ARGS} > result.txt
cmake-out/examples/models/yolo26/Yolo26DetectionDemo ${RUNTIME_ARGS} > result.txt
NOW=$(date +"%H:%M:%S")
echo "Finished at ${NOW}"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ ExecuTorch powers on-device AI at scale across Meta's family of apps, VR/AR devi

**Multimodal:** [Llava](examples/models/llava/README.md) (vision-language), [Voxtral](examples/models/voxtral/README.md) (audio-language), [Gemma](examples/models/gemma3) (vision-language)

**Vision/Speech:** [MobileNetV2](https://github.com/meta-pytorch/executorch-examples/tree/main/mv2), [DeepLabV3](https://github.com/meta-pytorch/executorch-examples/tree/main/dl3), [Whisper](examples/models/whisper/README.md) <!-- @lint-ignore -->
**Vision/Speech:** [MobileNetV2](https://github.com/meta-pytorch/executorch-examples/tree/main/mv2), [DeepLabV3](https://github.com/meta-pytorch/executorch-examples/tree/main/dl3), [YOLO26](examples/models/yolo26/README.md), [Whisper](examples/models/whisper/README.md) <!-- @lint-ignore -->

**Resources:** [`examples/`](examples/) directory • [executorch-examples](https://github.com/meta-pytorch/executorch-examples) out-of-tree demos • [Optimum-ExecuTorch](https://github.com/huggingface/optimum-executorch) for HuggingFace models • [Unsloth](https://docs.unsloth.ai/new/deploy-llms-phone) for fine-tuned LLM deployment <!-- @lint-ignore -->

Expand Down
8 changes: 7 additions & 1 deletion backends/openvino/quantizer/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,18 @@ def set_ignored_scope(
:param validate: If set to True, then a RuntimeError will be raised if any ignored scope does not match
in the model graph.
"""
subgraphs_ = []
if subgraphs:
subgraphs_ = [
nncf.Subgraph(inputs=subgraph[0], outputs=subgraph[1])
for subgraph in subgraphs
]
self._algo.set_ignored_scope(
nncf.IgnoredScope(
names=names or [],
patterns=patterns or [],
types=types or [],
subgraphs=subgraphs or [],
subgraphs=subgraphs_,
validate=validate,
Comment thread
daniil-lyakhov marked this conversation as resolved.
)
)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/success-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Automate PyTorch model deployment to iOS, Android, and edge devices with ExecuTo

- **LoRA adapter** - Export two LoRA adapters that share a single foundation weight file, saving memory and disk space. [Try →](https://github.com/meta-pytorch/executorch-examples/tree/main/program-data-separation/cpp/lora_example)

- **OpenVINO from Intel** - Deploy [Yolo12](https://github.com/pytorch/executorch/tree/main/examples/models/yolo12), [Llama](https://github.com/pytorch/executorch/tree/main/examples/openvino/llama), and [Stable Diffusion](https://github.com/pytorch/executorch/tree/main/examples/openvino/stable_diffusion) on [OpenVINO from Intel](https://www.intel.com/content/www/us/en/developer/articles/community/optimizing-executorch-on-ai-pcs.html).
- **OpenVINO from Intel** - Deploy [Yolo26](https://github.com/pytorch/executorch/tree/main/examples/models/yolo26), [Llama](https://github.com/pytorch/executorch/tree/main/examples/openvino/llama), and [Stable Diffusion](https://github.com/pytorch/executorch/tree/main/examples/openvino/stable_diffusion) on [OpenVINO from Intel](https://www.intel.com/content/www/us/en/developer/articles/community/optimizing-executorch-on-ai-pcs.html).

- **Audio Generation** - Generate audio from text prompts using Stable Audio Open Small on Arm CPUs with XNNPACK and KleidiAI. [Try →](https://github.com/Arm-Examples/ML-examples/tree/main/kleidiai-examples/audiogen-et) • [Video →](https://www.youtube.com/watch?v=q2P0ESVxhAY) <!-- @lint-ignore -->

Expand Down
151 changes: 0 additions & 151 deletions examples/models/yolo12/inference.h

This file was deleted.

2 changes: 0 additions & 2 deletions examples/models/yolo12/requirements.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(Yolo12DetectionDemo VERSION 0.1)
project(Yolo26DetectionDemo VERSION 0.1)

option(USE_OPENVINO_BACKEND "Build the tutorial with the OPENVINO backend" OFF)
option(USE_XNNPACK_BACKEND "Build the tutorial with the XNNPACK backend" OFF)
Expand Down Expand Up @@ -44,7 +44,8 @@ if(USE_XNNPACK_BACKEND)
endif()

if(USE_OPENVINO_BACKEND)
find_package(OpenVINO REQUIRED)
# The OpenVINO backend resolves symbols via dlopen at runtime, so there is no
# build-time dependency on the OpenVINO SDK (no find_package needed).
list(APPEND link_libraries openvino_backend)
executorch_target_link_options_shared_lib(openvino_backend)
endif()
Expand All @@ -63,14 +64,14 @@ set(PROJECT_SOURCES
${EXECUTORCH_ROOT}/extension/runner_util/inputs_portable.cpp
)

add_executable(Yolo12DetectionDemo ${PROJECT_SOURCES})
add_executable(Yolo26DetectionDemo ${PROJECT_SOURCES})
target_link_libraries(
Yolo12DetectionDemo PUBLIC ${link_libraries} ${OpenCV_LIBS} executorch_core
Yolo26DetectionDemo PUBLIC ${link_libraries} ${OpenCV_LIBS} executorch_core
extension_module extension_tensor
)

find_package(Threads REQUIRED)
target_link_libraries(Yolo12DetectionDemo PRIVATE Threads::Threads)
target_link_libraries(Yolo26DetectionDemo PRIVATE Threads::Threads)
target_include_directories(
Yolo12DetectionDemo PUBLIC ${_common_include_directories}
Yolo26DetectionDemo PUBLIC ${_common_include_directories}
)
Loading
Loading