Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
11 changes: 1 addition & 10 deletions .github/workflows/test_accuracy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,8 @@ jobs:
mkdir build && cd build
pip install nanobind==2.4.0
pip install typing_extensions==4.12.2
cmake ../tests/cpp/accuracy/
cmake ../tests/cpp
make -j
- name: Build CPP-PY Bindings
run: |
source venv/bin/activate
pip install src/cpp/py_bindings
- name: Run CPP Test
run: |
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
- name: Run CPP-PY Bindings Test
run: |
source venv/bin/activate
pip list
pytest --data=./data --config=./tests/python/accuracy/public_scope.json tests/cpp/accuracy/test_bindings.py
75 changes: 0 additions & 75 deletions .github/workflows/test_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,81 +47,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN}}
# missingInclude: cppcheck can't find stl, openvino, opencv
other_options: --suppress=missingInclude -Isrc/cpp/models/include -Isrc/cpp/utils/include -Isrc/cpp/pipelines/include --check-config
CPP-Precommit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
- name: Create and start a virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install src/python/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu

sudo bash src/cpp/install_dependencies.sh
- name: Prepare test data
run: |
source venv/bin/activate
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
- name: Build
run: |
mkdir build && cd build
pip install nanobind==2.4.0
pip install typing_extensions==4.12.2
cmake ../tests/cpp/precommit/
cmake --build . -j $((`nproc`*2+2))
- name: Run test
run: |
build/test_sanity -d data -p tests/cpp/precommit/public_scope.json && build/test_model_config -d data
CPP-Windows-Precommit:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Create and start a virtual environment
shell: bash
run: |
python -m venv venv
source venv/Scripts/activate
- name: Install dependencies
shell: bash
run: |
source venv/Scripts/activate
python -m pip install --upgrade pip
pip install src/python/[tests,build] --extra-index-url https://download.pytorch.org/whl/cpu
curl https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/windows/w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64.zip --output w_openvino_toolkit_windows.zip
unzip w_openvino_toolkit_windows.zip
rm w_openvino_toolkit_windows.zip
curl -L https://github.com/opencv/opencv/releases/download/4.10.0/opencv-4.10.0-windows.exe --output opencv-4.10.0-windows.exe
./opencv-4.10.0-windows.exe -oopencv -y
rm opencv-4.10.0-windows.exe
- name: Prepare test data
shell: bash
run: |
source venv/Scripts/activate
python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json
- name: Build
shell: bash
run: |
mkdir build && cd build
MSYS_NO_PATHCONV=1 cmake ../examples/cpp/ -DOpenVINO_DIR=$GITHUB_WORKSPACE/w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64/runtime/cmake -DOpenCV_DIR=$GITHUB_WORKSPACE/opencv/opencv/build -DCMAKE_CXX_FLAGS=/WX
cmake --build . --config Release -j $((`nproc`*2+2))
- name: Run sync sample
shell: cmd
# .\w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64\setupvars.bat exits with 0 code without moving to a next command. Set PATH manually
run: |
set PATH=opencv\opencv\build\x64\vc16\bin;w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64\runtime\bin\intel64\Release;w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64\runtime\3rdparty\tbb\bin;%PATH%
.\build\Release\synchronous_api.exe .\data\otx_models\detection_model_with_xai_head.xml .\data\BloodImage_00007.jpg
serving_api:
strategy:
fail-fast: false
Expand Down
3 changes: 1 addition & 2 deletions examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,4 @@ find_package(OpenCV REQUIRED COMPONENTS imgcodecs)

add_subdirectory(../../src/cpp ${Samples_BINARY_DIR}/src/cpp)

add_example(NAME asynchronous_api SOURCES ./asynchronous_api/main.cpp DEPENDENCIES model_api)
add_example(NAME synchronous_api SOURCES ./synchronous_api/main.cpp DEPENDENCIES model_api)
add_example(NAME synchronous_api SOURCES ./main.cpp DEPENDENCIES model_api)
File renamed without changes.
55 changes: 0 additions & 55 deletions examples/cpp/asynchronous_api/README.md

This file was deleted.

88 changes: 0 additions & 88 deletions examples/cpp/asynchronous_api/main.cpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*/

#include <models/detection_model.h>
#include <models/input_data.h>
#include <models/results.h>
#include <stddef.h>
#include <tasks/detection.h>
#include <tasks/results.h>

#include <cstdint>
#include <exception>
Expand All @@ -31,13 +30,13 @@ int main(int argc, char* argv[]) try {
}

// Instantiate Object Detection model
auto model = DetectionModel::create_model(argv[1]); // works with SSD models. Download it using Python Model API
auto model = DetectionModel::load(argv[1], {}); // works with SSD models. Download it using Python Model API

// Run the inference
auto result = model->infer(image);
auto result = model.infer(image);

// Process detections
for (auto& obj : result->objects) {
for (auto& obj : result.objects) {
std::cout << " " << std::left << std::setw(9) << obj.label << " | " << std::setw(10) << obj.confidence << " | "
<< std::setw(4) << int(obj.x) << " | " << std::setw(4) << int(obj.y) << " | " << std::setw(4)
<< int(obj.x + obj.width) << " | " << std::setw(4) << int(obj.y + obj.height) << "\n";
Expand Down
2 changes: 1 addition & 1 deletion examples/python/asynchronous_api/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2024 Intel Corporation
# Copyright (C) 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
2 changes: 1 addition & 1 deletion examples/python/serving_api/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2024 Intel Corporation
# Copyright (C) 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
2 changes: 1 addition & 1 deletion examples/python/synchronous_api/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2024 Intel Corporation
# Copyright (C) 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
2 changes: 1 addition & 1 deletion examples/python/visual_prompting/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2024 Intel Corporation
# Copyright (C) 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
2 changes: 1 addition & 1 deletion examples/python/zsl_visual_prompting/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2024 Intel Corporation
# Copyright (C) 2020-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

Expand Down
Loading