diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0fe20194..b208c90b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,8 +14,8 @@ Once you're done, someone will review your PR shortly (see the section "Who can Fixes # (issue) - ## Before submitting + - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [ ] Did you make sure to update the documentation with your changes? - [ ] Did you write any new necessary tests? diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml new file mode 100644 index 00000000..19136d08 --- /dev/null +++ b/.github/workflows/pre_commit.yml @@ -0,0 +1,29 @@ +name: Pre-Commit Checks +permissions: read-all + +on: + push: + branches: + - master + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + workflow_dispatch: # run on request (no need for PR) + +jobs: + Code-Quality-Checks: + runs-on: ubuntu-20.04 + steps: + - name: CHECKOUT REPOSITORY + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install dependencies + run: pip install 'model_api/python/.[full]' + - name: Run pre-commit checks + run: pre-commit run --all-files diff --git a/.github/workflows/test_accuracy.yml b/.github/workflows/test_accuracy.yml index cb06508e..46f50f21 100644 --- a/.github/workflows/test_accuracy.yml +++ b/.github/workflows/test_accuracy.yml @@ -8,38 +8,38 @@ jobs: test_accuracy: runs-on: ubuntu-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 - 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu - - name: Prepare test data - run: | - source venv/bin/activate - python tests/python/accuracy/prepare_data.py -d data - - name: Run Python Test - run: | - source venv/bin/activate - pytest --data=./data tests/python/accuracy/test_accuracy.py - DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py - - name: Install CPP ependencies - run: | - sudo bash model_api/cpp/install_dependencies.sh - - name: Build CPP Test - run: | - mkdir build && cd build - cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror - make -j - - name: Run CPP Test - run: | - build/test_accuracy -d data -p tests/python/accuracy/public_scope.json - DATA=data build/test_YOLOv8 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu + - name: Prepare test data + run: | + source venv/bin/activate + python tests/python/accuracy/prepare_data.py -d data + - name: Run Python Test + run: | + source venv/bin/activate + pytest --data=./data tests/python/accuracy/test_accuracy.py + DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py + - name: Install CPP ependencies + run: | + sudo bash model_api/cpp/install_dependencies.sh + - name: Build CPP Test + run: | + mkdir build && cd build + cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror + make -j + - name: Run CPP Test + run: | + build/test_accuracy -d data -p tests/python/accuracy/public_scope.json + DATA=data build/test_YOLOv8 diff --git a/.github/workflows/test_precommit.yml b/.github/workflows/test_precommit.yml index 0d5b1659..53bc9b84 100644 --- a/.github/workflows/test_precommit.yml +++ b/.github/workflows/test_precommit.yml @@ -8,58 +8,58 @@ jobs: Python-Code-Quality: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: git --no-pager diff --check $(git hash-object -t tree /dev/null) - run: git --no-pager diff --check $(git hash-object -t tree /dev/null) - - name: Prohibit non ASCII chars in file names - run: test $(git diff --name-only --diff-filter=A -z $(git hash-object -t tree /dev/null) | LC_ALL=C tr -d '[ -~]\0' | wc -c) == 0 - - run: "! git grep -n '[^ -~]' -- ':(exclude)model_api/python/README.md'" - - uses: actions/setup-python@v4 - with: - python-version: 3.9 - 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 - pip install --upgrade pip - pip install isort black - - name: Check style with black - run: | - source venv/bin/activate - black --check . - - name: Check style with isort - run: | - source venv/bin/activate - isort --check . + - uses: actions/checkout@v3 + - name: git --no-pager diff --check $(git hash-object -t tree /dev/null) + run: git --no-pager diff --check $(git hash-object -t tree /dev/null) + - name: Prohibit non ASCII chars in file names + run: test $(git diff --name-only --diff-filter=A -z $(git hash-object -t tree /dev/null) | LC_ALL=C tr -d '[ -~]\0' | wc -c) == 0 + - run: "! git grep -n '[^ -~]' -- ':(exclude)model_api/python/README.md'" + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + 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 + pip install --upgrade pip + pip install isort black + - name: Check style with black + run: | + source venv/bin/activate + black --check . + - name: Check style with isort + run: | + source venv/bin/activate + isort --check . Python-Precommit: runs-on: ubuntu-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 - 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu - - 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: Run test - run: | - source venv/bin/activate - pytest tests/python/precommit + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu + - 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: Run test + run: | + source venv/bin/activate + pytest tests/python/precommit CPP-Code-Quality: name: CPP-Code-Quality runs-on: ubuntu-latest @@ -74,102 +74,102 @@ jobs: CPP-Precommit: runs-on: ubuntu-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 - 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu - sudo bash model_api/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 - cmake ../tests/cpp/precommit/ -DCMAKE_CXX_FLAGS=-Werror - 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 + sudo bash model_api/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 + cmake ../tests/cpp/precommit/ -DCMAKE_CXX_FLAGS=-Werror + 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu - curl https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.1/windows/w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_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.1.0.15008.f4afc983258_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.1.0.15008.f4afc983258_x86_64\runtime\bin\intel64\Release;w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_x86_64\runtime\3rdparty\tbb\bin;%PATH% - .\build\Release\synchronous_api.exe .\data\public\ssd_mobilenet_v1_fpn_coco\FP16\ssd_mobilenet_v1_fpn_coco.xml .\data\BloodImage_00007.jpg + - 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 model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu + curl https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.1/windows/w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_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.1.0.15008.f4afc983258_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.1.0.15008.f4afc983258_x86_64\runtime\bin\intel64\Release;w_openvino_toolkit_windows_2024.1.0.15008.f4afc983258_x86_64\runtime\3rdparty\tbb\bin;%PATH% + .\build\Release\synchronous_api.exe .\data\public\ssd_mobilenet_v1_fpn_coco\FP16\ssd_mobilenet_v1_fpn_coco.xml .\data\BloodImage_00007.jpg serving_api: strategy: fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] - python-version: [3.9, '3.10', '3.11'] + python-version: [3.9, "3.10", "3.11"] exclude: - os: ubuntu-24.04 - python-version: '3.9' + python-version: "3.9" runs-on: ${{ matrix.os }} steps: - - name: Set up docker for macOS - if: startsWith(matrix.os, 'macos-1') - run: | - brew install colima docker - colima start - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: serving_api - run: | - python -m pip install --upgrade pip - python -m pip install model_api/python/[ovms,tests] - python -c "from model_api.models import DetectionModel; DetectionModel.create_model('ssd_mobilenet_v1_fpn_coco').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')" - docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 9000:9000 -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --rest_port 8000 --log_level DEBUG --target_device CPU - python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json - python examples/python/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects + - name: Set up docker for macOS + if: startsWith(matrix.os, 'macos-1') + run: | + brew install colima docker + colima start + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: serving_api + run: | + python -m pip install --upgrade pip + python -m pip install model_api/python/[ovms,tests] + python -c "from model_api.models import DetectionModel; DetectionModel.create_model('ssd_mobilenet_v1_fpn_coco').save('ovms_models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml')" + docker run -d --rm -v $GITHUB_WORKSPACE/ovms_models/:/models -p 9000:9000 -p 8000:8000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco/ --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --rest_port 8000 --log_level DEBUG --target_device CPU + python tests/cpp/precommit/prepare_data.py -d data -p tests/cpp/precommit/public_scope.json + python examples/python/serving_api/run.py data/coco128/images/train2017/000000000009.jpg # detects 4 objects diff --git a/.gitignore b/.gitignore index 70060f1e..8cb96df9 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ dmypy.json # Pyre type checker .pyre/ + +# vs-code +.vscode/ diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..3a948379 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,23 @@ +# Default state for all rules +default: true + +# Path to configuration file to extend +extends: null + +# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time +MD001: true + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 1000 + +# This is not useful for some files such as `CHANGELOG.md` +MD024: + # Only check sibling headings + siblings_only: true + +MD033: false + +# If a page is printed, it helps if the URL is viewable. +MD034: false # Bare URL used diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3d61adae --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +default_language_version: + node: 18.15.0 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + # list of supported hooks: https://pre-commit.com/hooks.html + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: debug-statements + - id: detect-private-key + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.41.0 + hooks: + - id: markdownlint diff --git a/README.md b/README.md index a1215811..9ced4f8d 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ # OpenVINO Model API + Model API is a set of wrapper classes for particular tasks and model architectures, simplifying data preprocess and postprocess as well as routine procedures (model loading, asynchronous execution, etc.). It is aimed at simplifying end-to-end model inference for different deployment scenarious, including local execution and serving. The Model API is based on the OpenVINO inference API. ## How it works + Model API searches for additional information required for model inference, data, pre/postprocessing, label names, etc. directly in OpenVINO Intermediate Representation. This information is used to prepare the inference data, process and output the inference results in a human-readable format. ## Features + - Python and C++ API - Automatic prefetch of public models from [OpenVINO Model Zoo](https://github.com/openvinotoolkit/open_model_zoo) (Python only) - Synchronous and asynchronous inference @@ -12,37 +15,52 @@ Model API searches for additional information required for model inference, data - Model preprocessing embedding for faster inference ## Installation + ### Python + - Clone this repository - Navigate to `model_api/python` folder - Run `pip install .` + ### C++ + - Install dependencies. For installation on Ubuntu, you can use the following script: + ```bash chmod +x model_api/cpp/install_dependencies.sh sudo model_api/cpp/install_dependencies.sh ``` - Build library: + - Create `build` folder and navigate into it: - ``` + + ```bash mkdir build && cd build ``` + - Run cmake: - ``` + + ```bash cmake ../model_api/cpp -DOpenCV_DIR= -DOpenVINO_DIR= ``` + - Build: - ``` + + ```bash cmake --build . -j ``` + - To build a `.tar.gz` package with the library, run: - ``` + + ```bash cmake --build . --target package -j ``` ## Usage + ### Python + ```python from model_api.models import DetectionModel @@ -58,6 +76,7 @@ print(f"Detection results: {detections}") ``` ### C++ + ```cpp #include #include @@ -77,20 +96,26 @@ for (auto& obj : result->objects) { Model's static method `create_model()` has two overloads. One constructs the model from a string (a path or a model name) (shown above) and the other takes an already constructed `InferenceAdapter`. -# Prepare a model for `InferenceAdapter` +## Prepare a model for `InferenceAdapter` + There are usecases when it is not possible to modify an internal `ov::Model` and it is hidden behind `InferenceAdapter`. For example the model can be served using [OVMS](https://github.com/openvinotoolkit/model_server). `create_model()` can construct a model from a given `InferenceAdapter`. That approach assumes that the model in `InferenceAdapter` was already configured by `create_model()` called with a string (a path or a model name). It is possible to prepare such model using C++ or Python: C++ + ```Cpp auto model = DetectionModel::create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml"); const std::shared_ptr& ov_model = model->getModel(); ov::serialize(ov_model, "serialized.xml"); ``` + Python + ```python model = DetectionModel.create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml") model.save("serialized.xml") ``` + After that the model can be constructed from `InferenceAdapter`: + ```cpp ov::Core core; std::shared_ptr ov_model = core.read_model("serialized.xml"); @@ -102,7 +127,9 @@ auto model = DetectionModel::create_model(adapter); For more details please refer to the [examples](https://github.com/openvinotoolkit/model_api/tree/master/examples) of this project. ## Supported models -### Python: + +### Python + - Image Classification: - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#classification-models) - Object Detection: @@ -122,8 +149,8 @@ For more details please refer to the [examples](https://github.com/openvinotoolk - Instance Segmentation: - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#instance-segmentation-models) +### C++ -### C++: - Image Classification: - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#classification-models) - Object Detection: diff --git a/docs/model-configuration.md b/docs/model-configuration.md index 3533775c..b19fa7c3 100644 --- a/docs/model-configuration.md +++ b/docs/model-configuration.md @@ -1,11 +1,16 @@ # Model configuration + Model's static method `create_model()` has two overloads. One constructs the model from a string (a path or a model name) and the other takes an already constructed `InferenceAdapter`. The first overload configures a created model with values taken from `configuration` dict function argument and from model's intermediate representation (IR) stored in `.xml` in `model_info` section of `rt_info`. Values provided in `configuration` have priority over values in IR `rt_info`. If no value is specified in `configuration` nor in `rt_info` the default value for a model wrapper is used. For Python configuration values are accessible as model wrapper member fields. + ## List of values + The list features only model wrappers which introduce new configuration values in their hierarchy. + 1. `model_type`: str - name of a model wrapper to be created 1. `layout`: str - layout of input data in the format: "input0:NCHW,input1:NC" ### `ImageModel` and its subclasses + 1. `mean_values`: List - normalization values, which will be subtracted from image channels for image-input layer during preprocessing 1. `scale_values`: List - normalization values, which will divide the image channels for image-input layer 1. `reverse_input_channels`: bool - reverse the input channel order @@ -22,6 +27,7 @@ The list features only model wrappers which introduce new configuration values i 1. `task`: str - Outputs segmentation masks, bounding boxes, or anomaly score based on the task type #### `ClassificationModel` + 1. `topk`: int - number of most likely labels 1. `labels`: List - list of class labels 1. `path_to_labels`: str - path to file with labels. Overrides the labels, if they sets via 'labels' parameter @@ -30,55 +36,83 @@ The list features only model wrappers which introduce new configuration values i 1. `confidence_threshold`: float - probability threshold value for multilabel or hierarchical predictions filtering 1. `hierarchical_config`: str - a serialized configuration for decoding hierarchical predictions 1. `output_raw_scores`: bool - output all scores for multiclass classification + #### `DetectionModel` and its subclasses + 1. `confidence_threshold`: float - probability threshold value for bounding box filtering 1. `labels`: List - List of class labels 1. `path_to_labels`: str - path to file with labels. Overrides the labels, if they sets via `labels` parameter + ##### `CTPN` + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering 1. `input_size`: List - image resolution which is going to be processed. Reshapes network to match a given size + ##### `FaceBoxes` + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering + ##### `NanoDet` + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering 1. `num_classes`: int - number of classes + ##### `UltraLightweightFaceDetection` + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering + ##### `YOLO` and its subclasses + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering + ###### `YoloV4` + 1. `anchors`: List - list of custom anchor values 1. `masks`: List - list of mask, applied to anchors for each output layer + ###### `YOLOv5`, `YOLOv8` + 1. `agnostic_nms`: bool - if True, the model is agnostic to the number of classes, and all classes are considered as one 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering + ###### `YOLOX` + 1. `iou_threshold`: float - threshold for non-maximum suppression (NMS) intersection over union (IOU) filtering + #### `HpeAssociativeEmbedding` + 1. `target_size`: int - image resolution which is going to be processed. Reshapes network to match a given size 1. `aspect_ratio`: float - image aspect ratio which is going to be processed. Reshapes network to match a given size 1. `confidence_threshold`: float - pose confidence threshold 1. `delta`: float 1. `size_divisor`: int - width and height of the reshaped model will be a multiple of this value 1. `padding_mode`: str - center or right_bottom + #### `OpenPose` + 1. `target_size`: int - image resolution which is going to be processed. Reshapes network to match a given size 1. `aspect_ratio`: float - image aspect ratio which is going to be processed. Reshapes network to match a given size 1. `confidence_threshold`: float - pose confidence threshold 1. `upsample_ratio`: int - upsample ratio of a model backbone 1. `size_divisor`: int - width and height of the reshaped model will be a multiple of this value + #### `MaskRCNNModel` + 1. `confidence_threshold`: float - probability threshold value for bounding box filtering 1. `labels`: List - list of class labels 1. `path_to_labels`: str - path to file with labels. Overrides the labels, if they sets via `labels` parameter 1. `postprocess_semantic_masks`: bool - resize and apply 0.5 threshold to instance segmentation masks + #### `SegmentationModel` and its subclasses + 1. `labels`: List - list of class labels 1. `path_to_labels`: str - path to file with labels. Overrides the labels, if they sets via 'labels' parameter 1. `blur_strength`: int - blurring kernel size. -1 value means no blurring and no soft_threshold 1. `soft_threshold`: float - probability threshold value for bounding box filtering. inf value means no blurring and no soft_threshold 1. `return_soft_prediction`: bool - return raw resized model prediction in addition to processed one + ### `ActionClassificationModel` + 1. `labels`: List - list of class labels 1. `path_to_labels`: str - path to file with labels. Overrides the labels, if they sets via 'labels' parameter 1. `mean_values`: List - normalization values, which will be subtracted from image channels for image-input layer during preprocessing @@ -90,10 +124,13 @@ The list features only model wrappers which introduce new configuration values i > **NOTE** `ActionClassificationModel` isn't subclass of ImageModel. ### `Bert` and its subclasses + 1. `vocab`: Dict - mapping from string token to int 1. `input_names`: str - comma-separated names of input layers 1. `enable_padding`: bool - should be input sequence padded to max sequence len or not + #### `BertQuestionAnswering` + 1. `output_names`: str - comma-separated names of output layers 1. `max_answer_token_num`: int 1. `squad_ver`: str - SQuAD dataset version used for training. Affects postprocessing diff --git a/docs/releasing-to-PyPI.md b/docs/releasing-to-PyPI.md index a1685688..d3b0fdec 100644 --- a/docs/releasing-to-PyPI.md +++ b/docs/releasing-to-PyPI.md @@ -1,3 +1,5 @@ +# Releasing to PyPI + ```bash py -m pip install --upgrade build # Remove master omz_tools. Will use one from openvino-dev @@ -7,4 +9,5 @@ py -m twine upload --username __token__ model_api/python/dist/* git tag X.Y.Z git push upstream X.Y.Z ``` + Pull request to increment `version` in `pyproject.toml` for the next release. diff --git a/examples/cpp/asynchronous_api/README.md b/examples/cpp/asynchronous_api/README.md index 726263fe..92636712 100644 --- a/examples/cpp/asynchronous_api/README.md +++ b/examples/cpp/asynchronous_api/README.md @@ -1,5 +1,7 @@ # Synchronous API example + This example demonstrates how to use a C++ API of OpenVINO Model API for asynchronous inference and its basic steps: + - Instantiate a model - Set a callback to grab inference results - Model inference @@ -7,34 +9,47 @@ This example demonstrates how to use a C++ API of OpenVINO Model API for asynchr - Process results of the batch inference ## Prerequisites + - Install third party dependencies by running the following script: - ```bash - chmod +x ../../../model_api/cpp/install_dependencies.sh - sudo ../../../model_api/cpp/install_dependencies.sh - ``` + + ```bash + chmod +x ../../../model_api/cpp/install_dependencies.sh + sudo ../../../model_api/cpp/install_dependencies.sh + ``` + - Build example: - - Create `build` folder and navigate into it: - ``` - mkdir build && cd build - ``` - - Run cmake: - ``` - cmake ../ - ``` - - Build: - ``` - make -j - ``` + + - Create `build` folder and navigate into it: + + ```bash + mkdir build && cd build + ``` + + - Run cmake: + + ```bash + cmake ../ + ``` + + - Build: + + ```bash + make -j + ``` + - Download a model by running a Python code with Model API, see Python [example](../../python/asynchronous_api/README.md): - ```python - from model_api.models import DetectionModel - model = DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco", - download_dir="tmp") - ``` + ```python + from model_api.models import DetectionModel + + model = DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco", + download_dir="tmp") + ``` ## Run example + To run the example, please execute the following command: + ```bash ./asynchronous_api ./tmp/public/ssd_mobilenet_v1_fpn_coco/FP16/ssd_mobilenet_v1_fpn_coco.xml ``` diff --git a/examples/cpp/synchronous_api/README.md b/examples/cpp/synchronous_api/README.md index cca34d38..ceda9bd9 100644 --- a/examples/cpp/synchronous_api/README.md +++ b/examples/cpp/synchronous_api/README.md @@ -1,38 +1,53 @@ # Synchronous API example + This example demonstrates how to use a C++ API of OpenVINO Model API for synchronous inference and its basic steps: + - Instantiate a model - Model inference - Process results ## Prerequisites + - Install third party dependencies by running the following script: - ```bash - chmod +x ../../../model_api/cpp/install_dependencies.sh - sudo ../../../model_api/cpp/install_dependencies.sh - ``` + + ```bash + chmod +x ../../../model_api/cpp/install_dependencies.sh + sudo ../../../model_api/cpp/install_dependencies.sh + ``` + - Build example: - - Create `build` folder and navigate into it: - ``` - mkdir build && cd build - ``` - - Run cmake: - ``` - cmake ../ - ``` - - Build: - ``` - make -j - ``` + + - Create `build` folder and navigate into it: + + ```bash + mkdir build && cd build + ``` + + - Run cmake: + + ```bash + cmake ../ + ``` + + - Build: + + ```bash + make -j + ``` + - Download a model by running a Python code with Model API, see Python [example](../../python/synchronous_api/README.md): - ```python - from model_api.models import DetectionModel - model = DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco", - download_dir="tmp") - ``` + ```python + from model_api.models import DetectionModel + + model = DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco", + download_dir="tmp") + ``` ## Run example + To run the example, please execute the following command: + ```bash ./synchronous_api ./tmp/public/ssd_mobilenet_v1_fpn_coco/FP16/ssd_mobilenet_v1_fpn_coco.xml ``` diff --git a/examples/python/asynchronous_api/README.md b/examples/python/asynchronous_api/README.md index d9a1eae8..1d17dfbd 100644 --- a/examples/python/asynchronous_api/README.md +++ b/examples/python/asynchronous_api/README.md @@ -1,15 +1,20 @@ # Asynchronous API example + This example demonstrates how to use a Python API of OpenVINO Model API for asynchronous inference and its basic steps: + - Instantiate a model - Define a callback function for results processing - Run inference - Fetch and process results ## Prerequisites + Install Model API from source. Please refer to the main [README](../../../README.md) for details. ## Run example + To run the example, please execute the following command: + ```bash python run.py ``` diff --git a/examples/python/serving_api/README.md b/examples/python/serving_api/README.md index e195d35e..3167a6ce 100644 --- a/examples/python/serving_api/README.md +++ b/examples/python/serving_api/README.md @@ -1,31 +1,40 @@ # Serving API example + This example demonstrates how to use a Python API of OpenVINO Model API for a remote inference of models hosted with [OpenVINO Model Server](https://docs.openvino.ai/latest/ovms_what_is_openvino_model_server.html). This tutorial assumes that you are familiar with Docker subsystem and includes the following steps: + - Run Docker image with - Instantiate a model - Run inference - Process results ## Prerequisites + - Install Model API from source. Please refer to the main [README](../../../README.md) for details. - Install Docker. Please refer to the [official documentation](https://docs.docker.com/get-docker/) for details. - Install OVMS client into the Python environment: - ```bash - pip install ovmsclient - ``` + + ```bash + pip install ovmsclient + ``` + - Download a model by running a Python code with Model API, see Python [exaple](../../python/synchronous_api/README.md) and resave a configured model at OVMS friendly folder layout: - ```python - from model_api.models import DetectionModel - DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco").save("/home/user/models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml") - ``` + ```python + from model_api.models import DetectionModel + + DetectionModel.create_model("ssd_mobilenet_v1_fpn_coco").save("/home/user/models/ssd_mobilenet_v1_fpn_coco/1/ssd_mobilenet_v1_fpn_coco.xml") + ``` + - Run docker with OVMS server: - ```bash - docker run -d -v /home/user/models:/models -p 9000:9000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --shape auto --nireq 4 --target_device CPU --plugin_config "{\"CPU_THROUGHPUT_STREAMS\": \"CPU_THROUGHPUT_AUTO\"}" - ``` + ```bash + docker run -d -v /home/user/models:/models -p 9000:9000 openvino/model_server:latest --model_path /models/ssd_mobilenet_v1_fpn_coco --model_name ssd_mobilenet_v1_fpn_coco --port 9000 --shape auto --nireq 4 --target_device CPU --plugin_config "{\"CPU_THROUGHPUT_STREAMS\": \"CPU_THROUGHPUT_AUTO\"}" + ``` ## Run example + To run the example, please execute the following command: + ```bash python run.py ``` diff --git a/examples/python/synchronous_api/README.md b/examples/python/synchronous_api/README.md index 4164d318..ebb671cc 100644 --- a/examples/python/synchronous_api/README.md +++ b/examples/python/synchronous_api/README.md @@ -1,17 +1,22 @@ # Synchronous API example + This example demonstrates how to use a Python API of OpenVINO Model API for synchronous inference as well as basic features such as: + - Automatic download and convertion of public models - Preprocessing embedding - Creating model from local source - Image Classification, Object Detection and Semantic Segmentation use cases ## Prerequisites + Install Model API from source. Please refer to the main [README](../../../README.md) for details. ## Run example + To run the example, please execute the following command: + ```bash python run.py ``` ->*NOTE*: results of Semantic Segmentation models are saved to `mask.png` file. \ No newline at end of file +> _NOTE_: results of Semantic Segmentation models are saved to `mask.png` file. diff --git a/examples/python/visual_prompting/README.md b/examples/python/visual_prompting/README.md index fc727b39..d5bfa287 100644 --- a/examples/python/visual_prompting/README.md +++ b/examples/python/visual_prompting/README.md @@ -1,31 +1,41 @@ # Segment Anything example + This example demonstrates how to use a Python API implementation of Segment Anything pipeline inference: + - Create encoder and decoder models - Create a visual prompter pipeline - Use points as prompts - Visualized result is saved to `sam_result.jpg` ## Prerequisites + Install Model API from source. Please refer to the main [README](../../../README.md) for details. ## Run example + To run the example, please execute the following command: + ```bash python run.py ``` + where prompts are in X Y format. To run the pipeline out-of-the box you can download the test data by running the following command from the repo root: + ```bash pip install httpx python tests/python/accuracy/prepare_data.py -d data ``` + and then run + ```bash python run.py ../../../data/coco128/images/train2017/000000000127.jpg \ ../../../data/otx_models/sam_vit_b_zsl_encoder.xml ../../../data/otx_models/sam_vit_b_zsl_decoder.xml \ 274 306 482 295 ``` + from the sample folder. Here two prompt poinst are passed via CLI: `(274, 306)` and `(482, 295)` ->*NOTE*: results of segmentation models are saved to `sam_result.jpg` file. +> _NOTE_: results of segmentation models are saved to `sam_result.jpg` file. diff --git a/examples/python/zsl_visual_prompting/README.md b/examples/python/zsl_visual_prompting/README.md index 948d75d5..ad47a332 100644 --- a/examples/python/zsl_visual_prompting/README.md +++ b/examples/python/zsl_visual_prompting/README.md @@ -1,5 +1,7 @@ # Zero-shot Segment Anything example + This example demonstrates how to use a Python API implementation of Zero-shot Segment Anything pipeline inference: + - Create encoder and decoder models - Create a zero-shot visual prompter pipeline - Use points as prompts to learn on one image @@ -7,28 +9,37 @@ This example demonstrates how to use a Python API implementation of Zero-shot Se - Visualized result is saved to `zsl_sam_result.jpg` ## Prerequisites + Install Model API from source. Please refer to the main [README](../../../README.md) for details. ## Run example + To run the example, please execute the following command: + ```bash python run.py -t ``` -where prompts are in X Y format. `t` is a threshold to match the reference features from the source image vs features obtained from the target image. + +where prompts are in X Y format. `t` is a threshold to match the reference features from the source image vs features +obtained from the target image. Higher thresholds leads to lower mask recall in the final prediction, i.e. low confidence masks can be filtered. To run the pipeline out-of-the box you can download the test data by running the following command from the repo root: + ```bash pip install httpx python tests/python/accuracy/prepare_data.py -d data ``` + and then run + ```bash python run.py ../../../data/coco128/images/train2017/000000000025.jpg \ ../../../data/coco128/images/train2017/000000000072.jpg ../../../data/otx_models/sam_vit_b_zsl_encoder.xml \ ../../../data/otx_models/sam_vit_b_zsl_decoder.xml 464 202 -t 0.7 ``` + from the sample folder. Here one prompt is passed via CLI: `(464 202)` ->*NOTE*: results of segmentation models are saved to `zsl_sam_result.jpg` file. +> _NOTE_: results of segmentation models are saved to `zsl_sam_result.jpg` file. diff --git a/model_api/python/README.md b/model_api/python/README.md index 1be4d327..2809e6d8 100644 --- a/model_api/python/README.md +++ b/model_api/python/README.md @@ -1,4 +1,4 @@ -# Python* Model API package +# Python\* Model API package Model API package is a set of wrapper classes for particular tasks and model architectures, simplifying data preprocess and postprocess as well as routine procedures (model loading, asynchronous execution, etc...) An application feeds model class with input data, then the model returns postprocessed output data in user-friendly format. @@ -6,13 +6,15 @@ An application feeds model class with input data, then the model returns postpro ## Package structure The Model API consists of 3 libraries: -* _adapters_ implements a common interface to allow Model API wrappers usage with different executors. See [Model API adapters](#model-api-adapters) section -* _models_ implements wrappers for Open Model Zoo models. See [Model API Wrappers](#model-api-wrappers) section -* _pipelines_ implements pipelines for model inference and manage the synchronous/asynchronous execution. See [Model API Pipelines](#model-api-pipelines) section + +- _adapters_ implements a common interface to allow Model API wrappers usage with different executors. See [Model API adapters](#model-api-adapters) section +- _models_ implements wrappers for Open Model Zoo models. See [Model API Wrappers](#model-api-wrappers) section +- _pipelines_ implements pipelines for model inference and manage the synchronous/asynchronous execution. See [Model API Pipelines](#model-api-pipelines) section ### Prerequisites The package requires + - one of OpenVINO supported Python version (see OpenVINO documentation for the details) - OpenVINO™ toolkit @@ -21,32 +23,38 @@ If you build Model API package from source, you should install the OpenVINO™ t Use installation package for [Intel® Distribution of OpenVINO™ toolkit](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit-download.html) or build the open-source version available in the [OpenVINO GitHub repository](https://github.com/openvinotoolkit/openvino) using the [build instructions](https://github.com/openvinotoolkit/openvino/wiki/BuildingCode). Also, you can install the OpenVINO Python\* package via the command: - ```sh + +```sh pip install openvino - ``` +``` -## Installing Python* Model API package +## Installing Python\* Model API package Use the following command to install Model API from source: + ```sh pip install /demos/common/python ``` Alternatively, you can generate the package using a wheel. Follow the steps below: + 1. Build the wheel. ```sh python /demos/common/python/setup.py bdist_wheel ``` + The wheel should appear in the dist folder. Name example: `openmodelzoo_modelapi-0.0.0-py3-none-any.whl` -2. Install the package in the clean environment with `--force-reinstall` key. +1. Install the package in the clean environment with `--force-reinstall` key. + ```sh pip install openmodelzoo_modelapi-0.0.0-py3-none-any.whl --force-reinstall ``` To verify the package is installed, you might use the following command: + ```sh python -c "from openvino.model_zoo import model_api" ``` @@ -57,15 +65,15 @@ The Model API package provides model wrappers, which implement standardized prep The following tasks can be solved with wrappers usage: -| Task type | Model API wrappers | -|----------------------------|--------------------| -| Classification |
  • `ClassificationModel`
| -| Human Pose Estimation |
  • `KeypointDetectionModel`
  • | -| Instance Segmentation |
    • `MaskRCNNModel`
    | -| Object Detection |
    • `SSD`
    • `YOLO`
    • `YoloV3ONNX`
    • `YoloV4`
    • `YOLOF`
    • `YOLOX`
    | -| Semantic Segmentation |
    • `SegmentationModel`
    | -| Visual Prompting |
    • `SAMDecoder`
    • `SAMImageEncoder`
    | -| Action Classification |
    • `ActionClassificationModel`
    | +| Task type | Model API wrappers | +| --------------------- | ------------------------------------------------------------------------------------------------------------ | +| Classification |
    • `ClassificationModel`
    | +| Human Pose Estimation |
    • `KeypointDetectionModel`
    • | +| Instance Segmentation |
      • `MaskRCNNModel`
      | +| Object Detection |
      • `SSD`
      • `YOLO`
      • `YoloV3ONNX`
      • `YoloV4`
      • `YOLOF`
      • `YOLOX`
      | +| Semantic Segmentation |
      • `SegmentationModel`
      | +| Visual Prompting |
      • `SAMDecoder`
      • `SAMImageEncoder`
      | +| Action Classification |
      • `ActionClassificationModel`
      | ## Model API Adapters @@ -73,29 +81,31 @@ Model API wrappers are executor-agnostic, meaning it does not implement the spec Currently, `OpenvinoAdapter` and `OVMSAdapter` are supported. -#### OpenVINO Adapter +### OpenVINO Adapter `OpenvinoAdapter` hides the OpenVINO™ toolkit API, which allows Model API wrappers launching with models represented in Intermediate Representation (IR) format. It accepts a path to either `xml` model file or `onnx` model file. -#### OpenVINO Model Server Adapter +### OpenVINO Model Server Adapter `OVMSAdapter` hides the OpenVINO Model Server python client API, which allows Model API wrappers launching with models served by OVMS. -Refer to __[`OVMSAdapter`](adapters/ovms_adapter.md)__ to learn about running demos with OVMS. +Refer to **[`OVMSAdapter`](adapters/ovms_adapter.md)** to learn about running demos with OVMS. For using OpenVINO Model Server Adapter you need to install the package with extra module: + ```sh pip install /demos/common/python[ovms] ``` -#### ONNXRuntime Adapter +### ONNXRuntime Adapter `ONNXRuntimeAdapter` hides the ONNXRuntime, which Model API wrappers launching with models represented in ONNX format. It accepts a path to `onnx` file. This adapter's functionality is limited: it doesn't support model reshaping, asynchronous inference and was tested only on limited scope of models. Supported model wrappers: `SSD`, `MaskRCNNModel`, `SegmentationModel`, and `ClassificationModel`. To use this adapter, install extra dependencies: + ```sh pip install onnx onnxruntime ``` @@ -111,7 +121,7 @@ The `AsyncPipeline` is available, which handles the asynchronous execution of a To apply Model API wrappers in custom applications, learn the provided example of common scenario of how to use Model API. - In the example, the SSD architecture is used to predict bounding boxes on input image `"sample.png"`. The model execution is produced by `OpenvinoAdapter`, therefore we submit the path to the model's `xml` file. +In the example, the SSD architecture is used to predict bounding boxes on input image `"sample.png"`. The model execution is produced by `OpenvinoAdapter`, therefore we submit the path to the model's `xml` file. Once the SSD model wrapper instance is created, we get the predictions by the model in one line: `ssd_model(input_data)` - the wrapper performs the preprocess method, synchronous inference on OpenVINO™ toolkit side and postprocess method. @@ -140,4 +150,4 @@ ssd_model = SSD(inference_adapter, preload=True) results = ssd_model(input_data) ``` -To study the complex scenarios, refer to Open Model Zoo Python* demos, where the asynchronous inference is applied. +To study the complex scenarios, refer to Open Model Zoo Python\* demos, where the asynchronous inference is applied. diff --git a/model_api/python/docs/action_classification.md b/model_api/python/docs/action_classification.md index 3e099cf3..16b20e31 100644 --- a/model_api/python/docs/action_classification.md +++ b/model_api/python/docs/action_classification.md @@ -11,6 +11,7 @@ Also, it doesn't use OV.PrePostProcessor() and therefore performs data preparati ## Model parameters The following parameters can be provided via python API or RT Info embedded into OV model: + - `labels`(`list[str]`) : List of class labels - `path_to_labels` (`str`) : Path to file with labels. Labels are overridden if it's set. - `mean_values` (`list[int | float]`) Normalization values to be subtracted from the image channels during preprocessing. @@ -55,7 +56,6 @@ Utilizing the ActionClassificationModel is similar to other model wrappers, with Below is an example demonstrating how to initialize the model with OpenVINO IR files and classify actions in a video clip. - ```python import cv2 import numpy as np @@ -84,4 +84,4 @@ results = action_cls_model(input_data) ``` As illustrated, initializing the model and performing inference can be achieved with minimal code. -The wrapper class takes care of input processing, layout adjustments, and output processing automatically. \ No newline at end of file +The wrapper class takes care of input processing, layout adjustments, and output processing automatically. diff --git a/model_api/python/docs/keypoint_detection.md b/model_api/python/docs/keypoint_detection.md index f2669365..a8cc344a 100644 --- a/model_api/python/docs/keypoint_detection.md +++ b/model_api/python/docs/keypoint_detection.md @@ -15,6 +15,7 @@ and a keypoints regression model acting on crops. ### Keypoint model parameters The following parameters can be provided via python API or RT Info embedded into OV model: + - `labels`(`list(str)`) : a list of keypoints names. ## OV model specifications @@ -26,6 +27,7 @@ A single NCHW tensor representing a batch of images. ### Outputs Two vectors in Simple Coordinate Classification Perspective ([SimCC](https://arxiv.org/abs/2107.03332)) format: + - `pred_x` (B, N, D1) - `x` coordinate representation, where `N` is the number of keypoints. - `pred_y` (B, N, D2) - `y` coordinate representation, where `N` is the number of keypoints. @@ -47,4 +49,4 @@ from model_api.models import TopDownKeypointDetectionPipeline, Detection, Keypoi cv2.circle( image, point, radius=0, color=(0, 255, 0), thickness=5 ) -``` \ No newline at end of file +``` diff --git a/model_api/python/docs/visual_prompting.md b/model_api/python/docs/visual_prompting.md index f803dbcb..45e0d27e 100644 --- a/model_api/python/docs/visual_prompting.md +++ b/model_api/python/docs/visual_prompting.md @@ -17,15 +17,17 @@ prepared inputs that includes prompts and outputs segmentation and some auxiliar ### Encoder parameters The following parameters can be provided via python API or RT Info embedded into OV model: + - `image_size`(`int`) : encoder native input resolution. The input is supposed to have 1:1 aspect ratio ### Decoder parameters The following parameters can be provided via python API or RT Info embedded into OV model: + - `image_size`(`int`) : encoder native input resolution. The input is supposed to have 1:1 aspect ratio - `mask_threshold`(`float`): threshold for generating hard predictions from output soft masks - `embed_dim`(`int`) : size of the output embedding. This parameter is provided for convenience and should match -the real output size. + the real output size. ## OV model specifications @@ -40,6 +42,7 @@ A single NDHW, where D is the embedding dimension. HW is the output feature spat ### Decoder inputs Decoder OV model should have the following named inputs: + - `image_embeddings` (B, D, H, W) - embeddings obtained with encoder - `point_coords` (B, N, 2) - 2D input prompts in XY format - `point_labels` (B, N) - integer labels of input point prompts @@ -56,4 +59,4 @@ Decoder OV model should have the following named inputs: ## How to use See demos: [VPT](https://github.com/openvinotoolkit/model_api/tree/master/examples/python/visual_prompting) -and [ZSL-VPT](https://github.com/openvinotoolkit/model_api/tree/master/examples/python/zsl_visual_prompting) \ No newline at end of file +and [ZSL-VPT](https://github.com/openvinotoolkit/model_api/tree/master/examples/python/zsl_visual_prompting) diff --git a/model_api/python/model_api/adapters/onnx_adapter.md b/model_api/python/model_api/adapters/onnx_adapter.md index a750bb42..b97763e8 100644 --- a/model_api/python/model_api/adapters/onnx_adapter.md +++ b/model_api/python/model_api/adapters/onnx_adapter.md @@ -5,6 +5,7 @@ The `ONNXRuntimeAdapter` implements `InferenceAdapter` interface. The `ONNXRunti ## Prerequisites `ONNXRuntimeAdapter` enables inference via ONNX Runtime, and we need to install it first: + ```sh pip install onnx onnxruntime ``` @@ -14,17 +15,19 @@ pip install onnx onnxruntime ModelAPI uses IR RTInfo to store metadata (wrapper-specific parameters, preprocessing parameters, labels list, etc.). For details see the implementation of `Model._load_config()` method. To embed that metadata into ONNX file, one can use ONNX properties: `metadata_props.add()` and use -ModelAPI-specific parameters as metadata keys with exactly the same names as in RTInfo, but split by spaces: `"model_info model_type"` and so on. +ModelAPI-specific parameters as metadata keys with exactly the same names as in RTInfo, but split by spaces: +`"model_info model_type"` and so on. ## Limitations - `ONNXRuntimeAdapter` is available in Python version of ModelAPI only. -- Although `ONNXRuntimeAdapter` doesn't use OpenVINO directly, OV should be installed, because Model API depends on it at the low level. -- Model reshape is not supported, and input shape should be defined in the model (excluding batch dimension) to perform shape inference and -parse model outputs successfully. +- Although `ONNXRuntimeAdapter` doesn't use OpenVINO directly, OV should be installed, because Model API depends on it at + the low level. +- Model reshape is not supported, and input shape should be defined in the model (excluding batch dimension) to perform + shape inference and parse model outputs successfully. - `model.load()` method does nothing, model is loaded in the constructor of `ONNXRuntimeAdapter`. - `ONNXRuntimeAdapter` supports only python-based preprocessing, and sometimes it gives slightly different results, than -OpenVINO operations graph-based preprocessing. Therefore, inference results can also be different than when using `OpenvinoAdapter`. + OpenVINO operations graph-based preprocessing. Therefore, inference results can also be different than when using `OpenvinoAdapter`. - Models scope is limited to `SSD`, `MaskRCNNModel`, `SegmentationModel`, and `ClassificationModel` wrappers. ## Running a model with ONNXRuntimeAdapter diff --git a/model_api/python/model_api/adapters/ovms_adapter.md b/model_api/python/model_api/adapters/ovms_adapter.md index 0032591c..a0bf4812 100644 --- a/model_api/python/model_api/adapters/ovms_adapter.md +++ b/model_api/python/model_api/adapters/ovms_adapter.md @@ -5,6 +5,7 @@ The `OVMSAdapter` implements `InferenceAdapter` interface. The `OVMSAdapter` mak ## Prerequisites `OVMSAdapter` enables inference via gRPC calls to OpenVINO Model Server, so in order to use it you need two things: + - OpenVINO Model Server that serves your model - [`ovmsclient`](https://pypi.org/project/ovmsclient/) package installed to enable communication with the model server: `python3 -m pip install ovmsclient` @@ -23,6 +24,7 @@ For some use cases you may want your model to reshape to match input of certain ### Inference options It's possible to configure inference related options for the model in OpenVINO Model Server with options: + - `--target_device` - name of the device to load the model to - `--nireq` - number of InferRequests - `--plugin_config` - configuration of the device plugin @@ -30,7 +32,8 @@ It's possible to configure inference related options for the model in OpenVINO M See [model server configuration parameters](https://github.com/openvinotoolkit/model_server/blob/main/docs/starting_server.md#serving-a-single-model) for more details. ### Example OVMS startup command -``` + +```bash docker run -d --rm -v /home/user/models:/models -p 9000:9000 openvino/model_server:latest --model_path /models/model1 --model_name model1 --port 9000 --shape auto --nireq 32 --target_device CPU --plugin_config "{\"CPU_THROUGHPUT_STREAMS\": \"CPU_THROUGHPUT_AUTO\"}" ``` @@ -40,17 +43,17 @@ docker run -d --rm -v /home/user/models:/models -p 9000:9000 openvino/model_serv To run the demo with model served in OpenVINO Model Server, you would have to provide `--adapter ovms` option and modify `-m` parameter to indicate model inference service instead of the model files. Model parameter for `OVMSAdapter` follows this schema: -```/models/[:]``` +`/models/[:]` - `` - OVMS gRPC service address in form `
      :` - `` - name of the target model (the one specified by `model_name` parameter in the model server startup command) -- `` *(optional)* - version of the target model (default: latest) +- `` _(optional)_ - version of the target model (default: latest) - Assuming that model server runs on the same machine as the demo, exposes gRPC service on port 9000 and serves model called `model1`, the value of `-m` parameter would be: +Assuming that model server runs on the same machine as the demo, exposes gRPC service on port 9000 and serves model called `model1`, the value of `-m` parameter would be: - `localhost:9000/models/model1` - requesting latest model version - `localhost:9000/models/model1:2` - requesting model version number 2 ## See Also -* [OpenVINO Model Server](https://github.com/openvinotoolkit/model_server) +- [OpenVINO Model Server](https://github.com/openvinotoolkit/model_server) diff --git a/model_api/python/pyproject.toml b/model_api/python/pyproject.toml index 341447b5..c5bb769b 100644 --- a/model_api/python/pyproject.toml +++ b/model_api/python/pyproject.toml @@ -36,6 +36,7 @@ ovms = [ "ovmsclient", ] tests = [ + "pre-commit", "httpx", "pytest", "openvino-dev[onnx,pytorch,tensorflow2]", @@ -43,6 +44,19 @@ tests = [ "onnx", "onnxruntime", ] +docs = [ + "myst-parser", + "nbsphinx", + "pandoc", + "sphinx", + "sphinx_autodoc_typehints", + "pydata-sphinx-theme", + "sphinx-copybutton", + "sphinx_design", + "breathe", + "graphviz", +] +full = ["openvino_model_api[dependencies, ovms, tests, docs]"] [project.urls] Homepage = "https://github.com/openvinotoolkit/model_api" diff --git a/tests/cpp/precommit/public_scope.json b/tests/cpp/precommit/public_scope.json index 1e617a05..b7ded6b1 100644 --- a/tests/cpp/precommit/public_scope.json +++ b/tests/cpp/precommit/public_scope.json @@ -1,26 +1,26 @@ [ - { - "name": "ssd_mobilenet_v1_fpn_coco", - "type": "DetectionModel" - }, - { - "name": "ssdlite_mobilenet_v2", - "type": "DetectionModel" - }, - { - "name": "efficientnet-b0-pytorch", - "type": "ClassificationModel" - }, - { - "name": "otx_models/mlc_mobilenetv3_large_voc.xml", - "type": "ClassificationModel" - }, - { - "name": "hrnet-v2-c1-segmentation", - "type": "SegmentationModel" - }, - { - "name": "otx_models/tinynet_imagenet.xml", - "type": "ClassificationModel" - } + { + "name": "ssd_mobilenet_v1_fpn_coco", + "type": "DetectionModel" + }, + { + "name": "ssdlite_mobilenet_v2", + "type": "DetectionModel" + }, + { + "name": "efficientnet-b0-pytorch", + "type": "ClassificationModel" + }, + { + "name": "otx_models/mlc_mobilenetv3_large_voc.xml", + "type": "ClassificationModel" + }, + { + "name": "hrnet-v2-c1-segmentation", + "type": "SegmentationModel" + }, + { + "name": "otx_models/tinynet_imagenet.xml", + "type": "ClassificationModel" + } ] diff --git a/tests/python/accuracy/public_scope.json b/tests/python/accuracy/public_scope.json index e9115dde..47f0ea10 100644 --- a/tests/python/accuracy/public_scope.json +++ b/tests/python/accuracy/public_scope.json @@ -1,448 +1,503 @@ [ - { - "name": "hrnet-v2-c1-segmentation", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["1: 0.326, 2: 0.012, 6: 0.324, 11: 0.175, 12: 0.024, 126: 0.046, 127: 0.092, [426,640,150], [0], [0]; wall: 0.970, 1881, building;edifice: 0.801, 246, ceiling: 0.936, 1660, cabinet: 0.345, 36, cabinet: 0.913, 1094, cabinet: 0.701, 534, cabinet: 0.911, 589, sidewalk;pavement: 0.204, 24, sidewalk;pavement: 0.188, 4, sidewalk;pavement: 0.555, 364, sidewalk;pavement: 0.571, 93, sidewalk;pavement: 0.625, 352, pot;flowerpot: 0.776, 607, animal;animate;being;beast;brute;creature;fauna: 0.939, 641, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-18.xml", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.537, 1: 0.463, [426,640,2], [0], [0]; object: 0.675, 508, object: 0.527, 65, object: 0.507, 18, object: 0.624, 144, object: 0.538, 67, object: 0.507, 15, object: 0.518, 41, object: 0.507, 8, object: 0.505, 14, object: 0.885, 2138, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-18_mod2.xml", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.992, 1: 0.008, [426,640,2], [0], [0]; object: 0.555, 112, object: 0.506, 17, object: 0.555, 154, object: 0.511, 19, object: 0.514, 52, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-s_mod2.xml", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.563, 1: 0.437, [426,640,2], [0], [0]; object: 0.520, 26, object: 0.530, 42, object: 0.501, 4, object: 0.507, 27, object: 0.503, 8, object: 0.502, 6, object: 0.505, 18, object: 0.504, 13, object: 0.524, 87, object: 0.521, 89, object: 0.757, 2706, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-s_mod2.onnx", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.563, 1: 0.437, [426,640,2], [0], [0]; object: 0.520, 26, object: 0.530, 42, object: 0.501, 4, object: 0.507, 27, object: 0.503, 8, object: 0.502, 6, object: 0.505, 18, object: 0.504, 13, object: 0.524, 87, object: 0.521, 89, object: 0.757, 2706, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-s_mod2.onnx", - "type": "SegmentationModel", - "force_ort": "True", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.561, 1: 0.439, [426,640,2], [0], [0]; object: 0.519, 26, object: 0.531, 42, object: 0.502, 21, object: 0.505, 9, object: 0.501, 4, object: 0.509, 22, object: 0.524, 85, object: 0.520, 93, object: 0.754, 2564, "] - } - ] - }, - { - "name": "otx_models/Lite-hrnet-x-mod3.xml", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.944, 1: 0.056, [426,640,2], [0], [0]; object: 0.505, 2, object: 0.518, 8, object: 0.512, 5, object: 0.506, 4, object: 0.526, 8, object: 0.529, 21, object: 0.513, 12, object: 0.535, 49, object: 0.505, 2, object: 0.512, 4, object: 0.547, 6, object: 0.511, 6, object: 0.503, 1, object: 0.539, 6, object: 0.543, 39, object: 0.529, 2, object: 0.516, 9, object: 0.565, 157, object: 0.524, 6, object: 0.528, 15, object: 0.521, 18, object: 0.502, 1, object: 0.537, 73, object: 0.513, 4, object: 0.524, 27, object: 0.513, 6, object: 0.538, 65, object: 0.501, 6, object: 0.504, 1, object: 0.507, 4, object: 0.502, 1, object: 0.518, 8, object: 0.530, 11, object: 0.502, 2, object: 0.516, 2, object: 0.506, 1, object: 0.567, 17, object: 0.502, 1, object: 0.512, 7, object: 0.538, 24, object: 0.507, 1, object: 0.534, 12, object: 0.537, 6, object: 0.519, 13, object: 0.505, 2, object: 0.517, 16, object: 0.505, 5, object: 0.506, 20, object: 0.508, 6, object: 0.519, 24, object: 0.507, 4, object: 0.506, 2, object: 0.511, 4, object: 0.556, 47, object: 0.510, 10, object: 0.500, 1, object: 0.504, 5, object: 0.501, 1, object: 0.510, 6, object: 0.549, 13, object: 0.509, 2, object: 0.510, 3, object: 0.514, 1, object: 0.529, 15, object: 0.551, 110, object: 0.504, 2, object: 0.503, 3, object: 0.518, 16, object: 0.511, 14, object: 0.502, 1, object: 0.523, 1, object: 0.533, 16, object: 0.568, 66, object: 0.582, 1793, "] - } - ] - }, - { - "name": "ssd_mobilenet_v1_fpn_coco", - "type": "DetectionModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0, 12, 172, 331, 2 (bicycle): 0.697; 62, 276, 363, 383, 18 (horse): 0.645; [0]; [0]"] - } - ] - }, - { - "name": "ssdlite_mobilenet_v2", - "type": "DetectionModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["320, 96, 336, 143, 1 (bicycle): 0.818; 284, 95, 300, 143, 1 (bicycle): 0.796; 353, 96, 372, 145, 1 (bicycle): 0.631; 1, 3, 160, 318, 2 (car): 0.889; 50, 279, 368, 385, 18 (sheep): 0.915; [0]; [0]"] - } - ] - }, - { - "name": "otx_models/det_mobilenetv2_atss_bccd.xml", - "type": "DetectionModel", - "test_data": [ - { - "image": "BloodImage_00007.jpg", - "reference": ["494, 159, 637, 308, 2 (WBC): 0.697; 28, 139, 135, 228, 1 (RBC): 0.628; 535, 375, 638, 479, 1 (RBC): 0.524; 513, 8, 633, 152, 1 (RBC): 0.430; 21, 291, 143, 399, 1 (RBC): 0.422; 196, 86, 410, 286, 1 (RBC): 0.422; [0]; [0]"] - } - ] - }, - { - "name": "otx_models/det_mobilenetv2_atss_bccd_onnx.onnx", - "type": "DetectionModel", - "test_data": [ - { - "image": "BloodImage_00007.jpg", - "reference": ["494, 159, 637, 308, 2 (WBC): 0.697; 28, 139, 135, 228, 1 (RBC): 0.628; 535, 375, 638, 479, 1 (RBC): 0.524; 513, 8, 633, 152, 1 (RBC): 0.430; 21, 291, 143, 399, 1 (RBC): 0.422; 196, 86, 410, 286, 1 (RBC): 0.422; [0]; [0]"] - } - ] - }, - { - "name": "otx_models/det_mobilenetv2_atss_bccd_onnx.onnx", - "type": "DetectionModel", - "force_ort": "True", - "test_data": [ - { - "image": "BloodImage_00007.jpg", - "reference": ["494, 159, 637, 308, 2 (WBC): 0.700; 28, 139, 136, 228, 1 (RBC): 0.623; 535, 374, 638, 479, 1 (RBC): 0.535; 513, 8, 633, 151, 1 (RBC): 0.454; 197, 86, 412, 286, 1 (RBC): 0.405; 21, 291, 143, 399, 1 (RBC): 0.401; [0]; [0]"] - } - ] - }, - { - "name": "resnet-18-pytorch", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["254 (pug): 0.153, [0], [0], [0]"] - } - ] - }, - { - "name": "efficientnet-b0-pytorch", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["245 (French_bulldog): 0.156, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/mlc_mobilenetv3_large_voc.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000081.jpg", - "reference": ["0 (aeroplane): 0.943, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/mlc_efficient_b0_voc.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["1 (bicycle): 0.768, 11 (dog): 0.876, 14 (person): 0.922, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/mlc_efficient_v2s_voc.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["1 (bicycle): 0.825, 11 (dog): 0.873, 14 (person): 0.824, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/cls_mobilenetv3_large_cars.xml", - "type": "ClassificationModel", - "check_extra_rt_info": "True", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["105 (194): 0.456, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/cls_mobilenetv3_large_cars.onnx", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["105 (194): 0.456, [0], [0], [196]"] - } - ] - }, - { - "name": "otx_models/cls_mobilenetv3_large_cars.onnx", - "type": "ClassificationModel", - "force_ort": "True", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["105 (194): 0.062, [0], [0], [196]"] - } - ] - }, - { - "name": "otx_models/cls_efficient_b0_cars.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["0 (1): 0.838, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/cls_efficient_b0_shuffled_outputs.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["4 (Circle): 0.943, 5 (Lion): 0.969, 3 (Non-Rigid): 0.503, 6 (Panda): 0.988, [1,7,7,7], [1,7], [0]"] - } - ] - }, - { - "name": "otx_models/cls_efficient_v2s_cars.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["0 (1): 0.849, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced.xml", - "type": "MaskRCNNModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["458, 106, 495, 150, 1 (bicycle): 0.818, 852, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (car): 0.753, 26728, RotatedRect: 79.739 177.262 251.785 156.656 87.397; 0; [0]; bicycle: 0.818, 139; car: 0.753, 622; "] - } - ] - }, - { - "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced_onnx.onnx", - "type": "MaskRCNNModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["458, 106, 495, 150, 1 (person): 0.818, 852, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (bicycle): 0.753, 26728, RotatedRect: 79.739 177.262 251.785 156.656 87.397; 0; [0]; person: 0.818, 139; bicycle: 0.753, 622; "] - } - ] - }, - { - "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced_onnx.onnx", - "type": "MaskRCNNModel", - "force_ort": "True", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["458, 106, 495, 150, 1 (person): 0.816, 851, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (bicycle): 0.754, 26748, RotatedRect: 79.762 177.261 251.785 156.702 87.397; 0; [0]; person: 0.816, 142; bicycle: 0.754, 622; "] - } - ] - }, - { - "name": "otx_models/is_resnet50_maskrcnn_coco_reduced.xml", - "type": "MaskRCNNModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["59, 277, 360, 380, 16 (horse): 0.999, 19053, RotatedRect: 210.000 327.500 101.000 296.000 90.000; 2, 9, 162, 318, 2 (car): 0.999, 31153, RotatedRect: 82.086 163.312 307.394 156.997 89.669; 294, 94, 316, 153, 1 (bicycle): 0.985, 840, RotatedRect: 305.000 123.500 59.000 18.000 90.000; 326, 97, 341, 136, 1 (bicycle): 0.974, 397, RotatedRect: 332.500 116.000 38.000 13.000 90.000; 461, 105, 493, 150, 1 (bicycle): 0.918, 846, RotatedRect: 476.052 126.972 27.619 47.834 16.928; 350, 92, 386, 149, 1 (bicycle): 0.807, 1458, RotatedRect: 369.319 119.891 54.848 34.230 82.405; 279, 110, 291, 146, 1 (bicycle): 0.788, 312, RotatedRect: 284.000 127.500 35.000 10.000 90.000; 0; [0]; horse: 0.999, 668; car: 0.999, 782; bicycle: 0.985, 127; bicycle: 0.974, 87; bicycle: 0.918, 122; bicycle: 0.807, 140; bicycle: 0.788, 79; "] - } - ] - }, - { - "name": "otx_models/mobilenet_v3_large_hc_cf.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000081.jpg", - "reference": ["3 (equilateral): 0.596, 1 (multi a): 0.922, 2 (multi b): 0.696, 5 (triangle): 0.993, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/classification_model_with_xai_head.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000081.jpg", - "reference": ["0 (horse): 0.543, [1,4,7,7], [1,1280,1,1], [0]"] - } - ] - }, - { - "name": "otx_models/detection_model_with_xai_head.xml", - "type": "DetectionModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["61, 277, 355, 379, 1 (person): 0.364; 461, 105, 495, 149, 1 (person): 0.305; [1,2,6,8]; [1,320,1,1]"] - } - ] - }, - { - "name": "otx_models/segmentation_model_with_xai_head.xml", - "type": "SegmentationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 1.000, 1: 0.000, [426,640,3], [426,640,3], [1,600,1,1]; backpack: 0.505, 2, "] - } - ] - }, - { - "name": "otx_models/maskrcnn_model_with_xai_head.xml", - "type": "MaskRCNNModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["61, 277, 358, 382, 17 (horse): 0.998, 18312, RotatedRect: 212.000 327.000 290.000 100.000 0.000; 1, 14, 162, 321, 2 (car): 0.994, 25867, RotatedRect: 54.067 173.034 285.208 156.889 61.996; 327, 96, 341, 134, 1 (bicycle): 0.930, 279, RotatedRect: 333.500 114.000 36.000 13.000 90.000; 460, 106, 493, 148, 1 (bicycle): 0.898, 786, RotatedRect: 476.284 126.621 27.308 45.993 19.179; 294, 93, 315, 153, 1 (bicycle): 0.869, 789, RotatedRect: 304.000 124.000 58.000 18.000 90.000; 278, 109, 290, 152, 1 (bicycle): 0.817, 355, RotatedRect: 283.500 130.000 42.000 11.000 90.000; 4, 4, 102, 191, 2 (car): 0.701, 9658, RotatedRect: 51.806 97.259 184.445 95.281 89.246; 270, 93, 290, 152, 1 (bicycle): 0.660, 723, RotatedRect: 280.500 122.500 17.000 59.000 0.000; 322, 114, 343, 152, 18 (sheep): 0.520, 298, RotatedRect: 332.000 133.000 34.000 14.000 90.000; 4; [1,1280,1,1]; "] - } - ] - }, - { - "name": "otx_models/maskrcnn_xai_tiling.xml", - "type": "MaskRCNNModel", - "tiler": "InstanceSegmentationTiler", - "extra_model": "otx_models/tile_classifier.xml", - "extra_type": "ImageModel", - "input_res": "(3500,3500)", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["1535, 585, 1662, 697, 2 (ellipse): 0.643, 9822, RotatedRect: 1598.500 641.500 111.000 109.000 90.000; 3091, 3097, 3105, 3112, 1 (rectangle): 0.483, 197, RotatedRect: 3097.500 3104.000 14.000 13.000 90.000; 2734, 60, 2867, 324, 1 (rectangle): 0.401, 30622, RotatedRect: 2800.000 188.500 255.000 132.000 90.000; 2; [1,1280,1,1]; ellipse: 0.643, 331; rectangle: 0.483, 48; rectangle: 0.401, 758; "] - } - ] - }, - { - "name": "otx_models/detection_model_with_xai_head.xml", - "type": "DetectionModel", - "tiler": "DetectionTiler", - "input_res": "(3500,3500)", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["336, 2275, 1944, 3114, 1 (person): 0.361; 2523, 862, 2709, 1224, 1 (person): 0.313; [1,2,35,46]; [1,320,1,1]"] - } - ] - }, - { - "name": "otx_models/anomaly_padim_bottle_mvtec.xml", - "type": "AnomalyDetection", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": [ - "anomaly_map min:151 max:255;pred_score:1.0;pred_label:Anomaly;pred_mask min:1 max:1;" - ] - } - ] - }, - { - "name": "otx_models/anomaly_stfpm_bottle_mvtec.xml", - "type": "AnomalyDetection", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": [ - "anomaly_map min:124 max:225;pred_score:0.9;pred_label:Anomaly;pred_mask min:0 max:1;" - ] - } - ] - }, - { - "name": "otx_models/deit-tiny.xml", - "type": "ClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": [ - "3 (cat): 0.648, [0], [0], [10]" - ] - } - ] - - }, - { - "name": "otx_models/action_cls_xd3_kinetic.xml", - "type": "ActionClassificationModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["38 (WritingOnBoard): 0.096, [0], [0], [0]"] - } - ] - }, - { - "name": "otx_models/sam_vit_b_zsl_decoder.xml", - "type": "SAMDecoder", - "prompter": "SAMLearnableVisualPrompter", - "encoder": "otx_models/sam_vit_b_zsl_encoder.xml", - "encoder_type": "SAMImageEncoder", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["mask sum: 108565; [385.0, 315.0] iou: 0.930 [335.0, 414.0] iou: 0.763 [44.0, 205.0] iou: 0.665 [605.0, 224.0] iou: 0.653, mask sum: 73920; [175.0, 215.0] iou: 0.781 [124.0, 165.0] iou: 0.651"] - } - ] - }, - { - "name": "otx_models/sam_vit_b_zsl_decoder.xml", - "type": "SAMDecoder", - "prompter": "SAMVisualPrompter", - "encoder": "otx_models/sam_vit_b_zsl_encoder.xml", - "encoder_type": "SAMImageEncoder", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["upscaled_masks min:-25.907 max:11.185;hard_predictions shape:(4, 427, 640);"] - } - ] - }, - { - "name": "otx_models/rtmpose_tiny.xml", - "type": "KeypointDetectionModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000471.jpg", - "reference": ["keypoints: (17, 2), keypoints_x_sum: 5700.000, scores: (17,)"] - } - ] - }, - { - "name": "otx_models/segnext_t_tiling.xml", - "type": "SegmentationModel", - "tiler": "SemanticSegmentationTiler", - "input_res": "(3500,3500)", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0: 0.272, 1: 0.728, [3500,3500,5], [0], [0]; background: 1.404, 311, background: 1.397, 44, background: 1.371, 34, background: 1.377, 12, background: 1.356, 155, background: 1.345, 12, background: 1.183, 219, background: 1.524, 8, background: 1.533, 4, background: 1.519, 2, background: 1.524, 4, background: 1.530, 6, background: 1.537, 2, background: 1.514, 4, background: 1.519, 8, background: 1.529, 6, background: 1.550, 6, background: 1.558, 4, background: 1.520, 2, background: 1.529, 4, background: 1.532, 6, background: 1.535, 6, background: 1.530, 2, background: 1.529, 50, background: 1.528, 22, background: 1.527, 38, background: 1.451, 1476, background: 1.345, 2743, background: 1.609, 2987, background: 1.636, 29909, "] - } - ] - } + { + "name": "hrnet-v2-c1-segmentation", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "1: 0.326, 2: 0.012, 6: 0.324, 11: 0.175, 12: 0.024, 126: 0.046, 127: 0.092, [426,640,150], [0], [0]; wall: 0.970, 1881, building;edifice: 0.801, 246, ceiling: 0.936, 1660, cabinet: 0.345, 36, cabinet: 0.913, 1094, cabinet: 0.701, 534, cabinet: 0.911, 589, sidewalk;pavement: 0.204, 24, sidewalk;pavement: 0.188, 4, sidewalk;pavement: 0.555, 364, sidewalk;pavement: 0.571, 93, sidewalk;pavement: 0.625, 352, pot;flowerpot: 0.776, 607, animal;animate;being;beast;brute;creature;fauna: 0.939, 641, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-18.xml", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.537, 1: 0.463, [426,640,2], [0], [0]; object: 0.675, 508, object: 0.527, 65, object: 0.507, 18, object: 0.624, 144, object: 0.538, 67, object: 0.507, 15, object: 0.518, 41, object: 0.507, 8, object: 0.505, 14, object: 0.885, 2138, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-18_mod2.xml", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.992, 1: 0.008, [426,640,2], [0], [0]; object: 0.555, 112, object: 0.506, 17, object: 0.555, 154, object: 0.511, 19, object: 0.514, 52, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-s_mod2.xml", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.563, 1: 0.437, [426,640,2], [0], [0]; object: 0.520, 26, object: 0.530, 42, object: 0.501, 4, object: 0.507, 27, object: 0.503, 8, object: 0.502, 6, object: 0.505, 18, object: 0.504, 13, object: 0.524, 87, object: 0.521, 89, object: 0.757, 2706, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-s_mod2.onnx", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.563, 1: 0.437, [426,640,2], [0], [0]; object: 0.520, 26, object: 0.530, 42, object: 0.501, 4, object: 0.507, 27, object: 0.503, 8, object: 0.502, 6, object: 0.505, 18, object: 0.504, 13, object: 0.524, 87, object: 0.521, 89, object: 0.757, 2706, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-s_mod2.onnx", + "type": "SegmentationModel", + "force_ort": "True", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.561, 1: 0.439, [426,640,2], [0], [0]; object: 0.519, 26, object: 0.531, 42, object: 0.502, 21, object: 0.505, 9, object: 0.501, 4, object: 0.509, 22, object: 0.524, 85, object: 0.520, 93, object: 0.754, 2564, " + ] + } + ] + }, + { + "name": "otx_models/Lite-hrnet-x-mod3.xml", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.944, 1: 0.056, [426,640,2], [0], [0]; object: 0.505, 2, object: 0.518, 8, object: 0.512, 5, object: 0.506, 4, object: 0.526, 8, object: 0.529, 21, object: 0.513, 12, object: 0.535, 49, object: 0.505, 2, object: 0.512, 4, object: 0.547, 6, object: 0.511, 6, object: 0.503, 1, object: 0.539, 6, object: 0.543, 39, object: 0.529, 2, object: 0.516, 9, object: 0.565, 157, object: 0.524, 6, object: 0.528, 15, object: 0.521, 18, object: 0.502, 1, object: 0.537, 73, object: 0.513, 4, object: 0.524, 27, object: 0.513, 6, object: 0.538, 65, object: 0.501, 6, object: 0.504, 1, object: 0.507, 4, object: 0.502, 1, object: 0.518, 8, object: 0.530, 11, object: 0.502, 2, object: 0.516, 2, object: 0.506, 1, object: 0.567, 17, object: 0.502, 1, object: 0.512, 7, object: 0.538, 24, object: 0.507, 1, object: 0.534, 12, object: 0.537, 6, object: 0.519, 13, object: 0.505, 2, object: 0.517, 16, object: 0.505, 5, object: 0.506, 20, object: 0.508, 6, object: 0.519, 24, object: 0.507, 4, object: 0.506, 2, object: 0.511, 4, object: 0.556, 47, object: 0.510, 10, object: 0.500, 1, object: 0.504, 5, object: 0.501, 1, object: 0.510, 6, object: 0.549, 13, object: 0.509, 2, object: 0.510, 3, object: 0.514, 1, object: 0.529, 15, object: 0.551, 110, object: 0.504, 2, object: 0.503, 3, object: 0.518, 16, object: 0.511, 14, object: 0.502, 1, object: 0.523, 1, object: 0.533, 16, object: 0.568, 66, object: 0.582, 1793, " + ] + } + ] + }, + { + "name": "ssd_mobilenet_v1_fpn_coco", + "type": "DetectionModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0, 12, 172, 331, 2 (bicycle): 0.697; 62, 276, 363, 383, 18 (horse): 0.645; [0]; [0]" + ] + } + ] + }, + { + "name": "ssdlite_mobilenet_v2", + "type": "DetectionModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "320, 96, 336, 143, 1 (bicycle): 0.818; 284, 95, 300, 143, 1 (bicycle): 0.796; 353, 96, 372, 145, 1 (bicycle): 0.631; 1, 3, 160, 318, 2 (car): 0.889; 50, 279, 368, 385, 18 (sheep): 0.915; [0]; [0]" + ] + } + ] + }, + { + "name": "otx_models/det_mobilenetv2_atss_bccd.xml", + "type": "DetectionModel", + "test_data": [ + { + "image": "BloodImage_00007.jpg", + "reference": [ + "494, 159, 637, 308, 2 (WBC): 0.697; 28, 139, 135, 228, 1 (RBC): 0.628; 535, 375, 638, 479, 1 (RBC): 0.524; 513, 8, 633, 152, 1 (RBC): 0.430; 21, 291, 143, 399, 1 (RBC): 0.422; 196, 86, 410, 286, 1 (RBC): 0.422; [0]; [0]" + ] + } + ] + }, + { + "name": "otx_models/det_mobilenetv2_atss_bccd_onnx.onnx", + "type": "DetectionModel", + "test_data": [ + { + "image": "BloodImage_00007.jpg", + "reference": [ + "494, 159, 637, 308, 2 (WBC): 0.697; 28, 139, 135, 228, 1 (RBC): 0.628; 535, 375, 638, 479, 1 (RBC): 0.524; 513, 8, 633, 152, 1 (RBC): 0.430; 21, 291, 143, 399, 1 (RBC): 0.422; 196, 86, 410, 286, 1 (RBC): 0.422; [0]; [0]" + ] + } + ] + }, + { + "name": "otx_models/det_mobilenetv2_atss_bccd_onnx.onnx", + "type": "DetectionModel", + "force_ort": "True", + "test_data": [ + { + "image": "BloodImage_00007.jpg", + "reference": [ + "494, 159, 637, 308, 2 (WBC): 0.700; 28, 139, 136, 228, 1 (RBC): 0.623; 535, 374, 638, 479, 1 (RBC): 0.535; 513, 8, 633, 151, 1 (RBC): 0.454; 197, 86, 412, 286, 1 (RBC): 0.405; 21, 291, 143, 399, 1 (RBC): 0.401; [0]; [0]" + ] + } + ] + }, + { + "name": "resnet-18-pytorch", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": ["254 (pug): 0.153, [0], [0], [0]"] + } + ] + }, + { + "name": "efficientnet-b0-pytorch", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": ["245 (French_bulldog): 0.156, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/mlc_mobilenetv3_large_voc.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000081.jpg", + "reference": ["0 (aeroplane): 0.943, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/mlc_efficient_b0_voc.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "1 (bicycle): 0.768, 11 (dog): 0.876, 14 (person): 0.922, [0], [0], [0]" + ] + } + ] + }, + { + "name": "otx_models/mlc_efficient_v2s_voc.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "1 (bicycle): 0.825, 11 (dog): 0.873, 14 (person): 0.824, [0], [0], [0]" + ] + } + ] + }, + { + "name": "otx_models/cls_mobilenetv3_large_cars.xml", + "type": "ClassificationModel", + "check_extra_rt_info": "True", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["105 (194): 0.456, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/cls_mobilenetv3_large_cars.onnx", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["105 (194): 0.456, [0], [0], [196]"] + } + ] + }, + { + "name": "otx_models/cls_mobilenetv3_large_cars.onnx", + "type": "ClassificationModel", + "force_ort": "True", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["105 (194): 0.062, [0], [0], [196]"] + } + ] + }, + { + "name": "otx_models/cls_efficient_b0_cars.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["0 (1): 0.838, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/cls_efficient_b0_shuffled_outputs.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": [ + "4 (Circle): 0.943, 5 (Lion): 0.969, 3 (Non-Rigid): 0.503, 6 (Panda): 0.988, [1,7,7,7], [1,7], [0]" + ] + } + ] + }, + { + "name": "otx_models/cls_efficient_v2s_cars.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["0 (1): 0.849, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced.xml", + "type": "MaskRCNNModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "458, 106, 495, 150, 1 (bicycle): 0.818, 852, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (car): 0.753, 26728, RotatedRect: 79.739 177.262 251.785 156.656 87.397; 0; [0]; bicycle: 0.818, 139; car: 0.753, 622; " + ] + } + ] + }, + { + "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced_onnx.onnx", + "type": "MaskRCNNModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "458, 106, 495, 150, 1 (person): 0.818, 852, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (bicycle): 0.753, 26728, RotatedRect: 79.739 177.262 251.785 156.656 87.397; 0; [0]; person: 0.818, 139; bicycle: 0.753, 622; " + ] + } + ] + }, + { + "name": "otx_models/is_efficientnetb2b_maskrcnn_coco_reduced_onnx.onnx", + "type": "MaskRCNNModel", + "force_ort": "True", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "458, 106, 495, 150, 1 (person): 0.816, 851, RotatedRect: 478.119 130.332 28.677 46.408 46.637; 0, 30, 178, 323, 2 (bicycle): 0.754, 26748, RotatedRect: 79.762 177.261 251.785 156.702 87.397; 0; [0]; person: 0.816, 142; bicycle: 0.754, 622; " + ] + } + ] + }, + { + "name": "otx_models/is_resnet50_maskrcnn_coco_reduced.xml", + "type": "MaskRCNNModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "59, 277, 360, 380, 16 (horse): 0.999, 19053, RotatedRect: 210.000 327.500 101.000 296.000 90.000; 2, 9, 162, 318, 2 (car): 0.999, 31153, RotatedRect: 82.086 163.312 307.394 156.997 89.669; 294, 94, 316, 153, 1 (bicycle): 0.985, 840, RotatedRect: 305.000 123.500 59.000 18.000 90.000; 326, 97, 341, 136, 1 (bicycle): 0.974, 397, RotatedRect: 332.500 116.000 38.000 13.000 90.000; 461, 105, 493, 150, 1 (bicycle): 0.918, 846, RotatedRect: 476.052 126.972 27.619 47.834 16.928; 350, 92, 386, 149, 1 (bicycle): 0.807, 1458, RotatedRect: 369.319 119.891 54.848 34.230 82.405; 279, 110, 291, 146, 1 (bicycle): 0.788, 312, RotatedRect: 284.000 127.500 35.000 10.000 90.000; 0; [0]; horse: 0.999, 668; car: 0.999, 782; bicycle: 0.985, 127; bicycle: 0.974, 87; bicycle: 0.918, 122; bicycle: 0.807, 140; bicycle: 0.788, 79; " + ] + } + ] + }, + { + "name": "otx_models/mobilenet_v3_large_hc_cf.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000081.jpg", + "reference": [ + "3 (equilateral): 0.596, 1 (multi a): 0.922, 2 (multi b): 0.696, 5 (triangle): 0.993, [0], [0], [0]" + ] + } + ] + }, + { + "name": "otx_models/classification_model_with_xai_head.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000081.jpg", + "reference": ["0 (horse): 0.543, [1,4,7,7], [1,1280,1,1], [0]"] + } + ] + }, + { + "name": "otx_models/detection_model_with_xai_head.xml", + "type": "DetectionModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "61, 277, 355, 379, 1 (person): 0.364; 461, 105, 495, 149, 1 (person): 0.305; [1,2,6,8]; [1,320,1,1]" + ] + } + ] + }, + { + "name": "otx_models/segmentation_model_with_xai_head.xml", + "type": "SegmentationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 1.000, 1: 0.000, [426,640,3], [426,640,3], [1,600,1,1]; backpack: 0.505, 2, " + ] + } + ] + }, + { + "name": "otx_models/maskrcnn_model_with_xai_head.xml", + "type": "MaskRCNNModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "61, 277, 358, 382, 17 (horse): 0.998, 18312, RotatedRect: 212.000 327.000 290.000 100.000 0.000; 1, 14, 162, 321, 2 (car): 0.994, 25867, RotatedRect: 54.067 173.034 285.208 156.889 61.996; 327, 96, 341, 134, 1 (bicycle): 0.930, 279, RotatedRect: 333.500 114.000 36.000 13.000 90.000; 460, 106, 493, 148, 1 (bicycle): 0.898, 786, RotatedRect: 476.284 126.621 27.308 45.993 19.179; 294, 93, 315, 153, 1 (bicycle): 0.869, 789, RotatedRect: 304.000 124.000 58.000 18.000 90.000; 278, 109, 290, 152, 1 (bicycle): 0.817, 355, RotatedRect: 283.500 130.000 42.000 11.000 90.000; 4, 4, 102, 191, 2 (car): 0.701, 9658, RotatedRect: 51.806 97.259 184.445 95.281 89.246; 270, 93, 290, 152, 1 (bicycle): 0.660, 723, RotatedRect: 280.500 122.500 17.000 59.000 0.000; 322, 114, 343, 152, 18 (sheep): 0.520, 298, RotatedRect: 332.000 133.000 34.000 14.000 90.000; 4; [1,1280,1,1]; " + ] + } + ] + }, + { + "name": "otx_models/maskrcnn_xai_tiling.xml", + "type": "MaskRCNNModel", + "tiler": "InstanceSegmentationTiler", + "extra_model": "otx_models/tile_classifier.xml", + "extra_type": "ImageModel", + "input_res": "(3500,3500)", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "1535, 585, 1662, 697, 2 (ellipse): 0.643, 9822, RotatedRect: 1598.500 641.500 111.000 109.000 90.000; 3091, 3097, 3105, 3112, 1 (rectangle): 0.483, 197, RotatedRect: 3097.500 3104.000 14.000 13.000 90.000; 2734, 60, 2867, 324, 1 (rectangle): 0.401, 30622, RotatedRect: 2800.000 188.500 255.000 132.000 90.000; 2; [1,1280,1,1]; ellipse: 0.643, 331; rectangle: 0.483, 48; rectangle: 0.401, 758; " + ] + } + ] + }, + { + "name": "otx_models/detection_model_with_xai_head.xml", + "type": "DetectionModel", + "tiler": "DetectionTiler", + "input_res": "(3500,3500)", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "336, 2275, 1944, 3114, 1 (person): 0.361; 2523, 862, 2709, 1224, 1 (person): 0.313; [1,2,35,46]; [1,320,1,1]" + ] + } + ] + }, + { + "name": "otx_models/anomaly_padim_bottle_mvtec.xml", + "type": "AnomalyDetection", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "anomaly_map min:151 max:255;pred_score:1.0;pred_label:Anomaly;pred_mask min:1 max:1;" + ] + } + ] + }, + { + "name": "otx_models/anomaly_stfpm_bottle_mvtec.xml", + "type": "AnomalyDetection", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "anomaly_map min:124 max:225;pred_score:0.9;pred_label:Anomaly;pred_mask min:0 max:1;" + ] + } + ] + }, + { + "name": "otx_models/deit-tiny.xml", + "type": "ClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": ["3 (cat): 0.648, [0], [0], [10]"] + } + ] + }, + { + "name": "otx_models/action_cls_xd3_kinetic.xml", + "type": "ActionClassificationModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": ["38 (WritingOnBoard): 0.096, [0], [0], [0]"] + } + ] + }, + { + "name": "otx_models/sam_vit_b_zsl_decoder.xml", + "type": "SAMDecoder", + "prompter": "SAMLearnableVisualPrompter", + "encoder": "otx_models/sam_vit_b_zsl_encoder.xml", + "encoder_type": "SAMImageEncoder", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": [ + "mask sum: 108565; [385.0, 315.0] iou: 0.930 [335.0, 414.0] iou: 0.763 [44.0, 205.0] iou: 0.665 [605.0, 224.0] iou: 0.653, mask sum: 73920; [175.0, 215.0] iou: 0.781 [124.0, 165.0] iou: 0.651" + ] + } + ] + }, + { + "name": "otx_models/sam_vit_b_zsl_decoder.xml", + "type": "SAMDecoder", + "prompter": "SAMVisualPrompter", + "encoder": "otx_models/sam_vit_b_zsl_encoder.xml", + "encoder_type": "SAMImageEncoder", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": [ + "upscaled_masks min:-25.907 max:11.185;hard_predictions shape:(4, 427, 640);" + ] + } + ] + }, + { + "name": "otx_models/rtmpose_tiny.xml", + "type": "KeypointDetectionModel", + "test_data": [ + { + "image": "coco128/images/train2017/000000000471.jpg", + "reference": [ + "keypoints: (17, 2), keypoints_x_sum: 5700.000, scores: (17,)" + ] + } + ] + }, + { + "name": "otx_models/segnext_t_tiling.xml", + "type": "SegmentationModel", + "tiler": "SemanticSegmentationTiler", + "input_res": "(3500,3500)", + "test_data": [ + { + "image": "coco128/images/train2017/000000000074.jpg", + "reference": [ + "0: 0.272, 1: 0.728, [3500,3500,5], [0], [0]; background: 1.404, 311, background: 1.397, 44, background: 1.371, 34, background: 1.377, 12, background: 1.356, 155, background: 1.345, 12, background: 1.183, 219, background: 1.524, 8, background: 1.533, 4, background: 1.519, 2, background: 1.524, 4, background: 1.530, 6, background: 1.537, 2, background: 1.514, 4, background: 1.519, 8, background: 1.529, 6, background: 1.550, 6, background: 1.558, 4, background: 1.520, 2, background: 1.529, 4, background: 1.532, 6, background: 1.535, 6, background: 1.530, 2, background: 1.529, 50, background: 1.528, 22, background: 1.527, 38, background: 1.451, 1476, background: 1.345, 2743, background: 1.609, 2987, background: 1.636, 29909, " + ] + } + ] + } ]