# Installation
wget -q https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.2/linux/l_openvino_toolkit_ubuntu22_2023.2.0.13089.cfd42bd2cb0_x86_64.tgz -O openvino.tgz
sudo mkdir -p /opt/intel/openvino
sudo tar -xf openvino.tgz -C /opt/intel/openvino --strip-components=1
sudo apt-get install -y libtbb2 libpugixml1v5
# Install dependencies
cd /opt/intel/openvino/install_dependencies
sudo -E ./install_openvino_dependencies.sh
cmake_minimum_required(VERSION 3.5) | |
project(tests) | |
set(ORT_ROOT_DIR "/path/to/onnxruntime") | |
set(ORT_INCLUDE_DIR "${ORT_ROOT_DIR}/include") | |
set(ORT_BUILD_DIR "${ORT_ROOT_DIR}/build/MacOS/RelWithDebInfo") | |
#set(OCV_ROOT_DIR "/path/to/opencv") | |
#set(OCV_BUILD_DIR "${OCV_ROOT_DIR}/build/install") |
cmake_minimum_required(VERSION 3.13) | |
project("CLBlast performance test") | |
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
find_package(OpenCL) | |
find_package(CLBlast HINTS "/home/opencv-cn/Workspace/others/CLBlast/build/install") | |
message(STATUS "CLBlast_FOUND=${CLBlast_FOUND}, CLBlast_INCLUDE_DIRS=${CLBlast_INCLUDE_DIRS}, CLBlast_LIBS=${CLBlast_LIBS}") |
''' | |
| Configuration | Gemm | InnerProduct | | |
| - | - | - | | |
| A=, B=, C=, transA=, transB=| - | - | | |
''' | |
import argparse |
FROM ubuntu:18.04 | |
WORKDIR /root | |
RUN cp -a /etc/apt/sources.list /etc/apt/sources.list.bak \ | |
&& sed -i "s@http://.*security.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list \ | |
&& sed -i "s@https://.*security.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list \ | |
&& sed -i "s@http://.*archive.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list \ | |
&& sed -i "s@https://.*archive.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list \ | |
&& apt-get -y update \ | |
&& DEBIAN_FRONTEND=noninteractive apt install -y tzdata \ |
CANN (Compute Architecture of Neural Networks), developped by Huawei, is a heterogeneous computing architecture for AI. With CANN backend in OpenCV DNN, you can run your AI models on the Ascend NPU. Learn more about Ascend NPU and the CANN library from en_doc, cn_doc. Please note that OpenCV DNN supports CANN backend on Ascend 310 for now.
To use OpenCV DNN with CANN backend, read the following sections:
- Install dependencies,
- Install CANN,
- Compile OpenCV with CANN,
- Python and C++ samples
- OpenCV Zoo benchmark
cmake_minimum_required(VERSION 3.16.3) | |
project(ascend-conv2d) | |
# Find OpenCV | |
find_package(OpenCV 4.5.4 REQUIRED) | |
include_directories(${OpenCV_INCLUDE_DIRS}) | |
FROM yuentau/ocv_ubuntu:20.04 | |
WORKDIR /opt | |
RUN git clone https://github.com/opencv/opencv | |
RUN cmake -B opencv-build -D WITH_TIMVX=ON opencv | |
RUN cmake --build opencv-build -j 8 | |
# unit tests | |
# 1. setup env var | |
# 2. run tests |
We are thrilled to introduce you the TIM-VX backend integrated in OpenCV DNN, which allows OpenCV DNN runs quantized DL models in neural processing units (NPU) on edge devices, such as Khadas VIM3 etc. It achives up to 2X faster than ARM CPU backend for running face detection and recognition model from OpenCV Zoo. More details can be found in OpenCV Zoo Benchmarks.
TIM-VX is provided with x86_64 simulator. So you can try OpenCV with TIM-VX backend on your x86_64 machine following steps below, or if you happen to have a physical board equiped with the A311D chip (like the Khadas VIM3 mentioned above). In this guide, we provide two ways compiling OpenCV with TIM-VX backend:
- (Recommanded) Compile OpenCV together with TIM-VX.
- Compile OpenCV with TIM-VX library installed previously.
cmake_minimum_required(VERSION 2.8.12) | |
project(libfacedetection_opencvdnn) | |
# OpenCV | |
find_package(OpenCV 4.5.4 REQUIRED) | |
include_directories(${OpenCV_INCLUDE_DIRS}) | |
add_executable(detect detect.cpp) | |
target_link_libraries(detect ${OpenCV_LIBS}) |