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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 12 additions & 56 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Run pre-commit checks
run: uvx pre-commit run --all-files

accuracy-tests:
unit-functional-tests:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -85,10 +85,15 @@ jobs:
download.pytorch.org:443
files.pythonhosted.org:443
github.com:443
incoming.telemetry.mozilla.org:443
ocsp.digicert.com:443
ocsp.sectigo.com:443
pypi.org:443
raw.githubusercontent.com:443
releases.astral.sh:443
settings-win.data.microsoft.com:443
storage.geti.intel.com:443
telemetry-incoming.r53-2.services.mozilla.com:443

- *checkout

Expand All @@ -100,68 +105,18 @@ jobs:
python-version: ${{ matrix.python-version }}
version: "0.11.13"

- &install-dependencies
name: Install dependencies
- name: Install dependencies
run: uv --directory model_api sync --locked --group tests --extra-index-url https://download.pytorch.org/whl/cpu

- name: Prepare test data
run: uv --directory model_api run python tests/accuracy/download_models.py -d data -j tests/accuracy/public_scope.json -l

- name: Run Python Test
run: uv --directory model_api run pytest --data=./data tests/accuracy/test_accuracy.py

unit-functional-tests:
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-24.04"
- "windows-2022"
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
name: unit & functional tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
steps:
- name: Harden the runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
disable-sudo: true
disable-telemetry: true
egress-policy: block
allowed-endpoints: >
dc.services.visualstudio.com:443
download.pytorch.org:443
files.pythonhosted.org:443
github.com:443
incoming.telemetry.mozilla.org:443
ocsp.digicert.com:443
ocsp.sectigo.com:443
pypi.org:443
raw.githubusercontent.com:443
releases.astral.sh:443
settings-win.data.microsoft.com:443
storage.geti.intel.com:443
telemetry-incoming.r53-2.services.mozilla.com:443

- *checkout

- *matrix-setup-uv

- *install-dependencies

- name: Run model_api unit tests
run: uv --directory model_api run pytest tests/unit --cov

- name: Run model_converter unit tests
run: uv --directory model_converter run --group tests pytest tests/unit --cov

- &prepare-test-data
name: Prepare test data
- name: Prepare test data
run: |
uv --directory model_api run python tests/accuracy/download_models.py -d data -j tests/precommit/public_scope.json -l
uv --directory model_api run python tests/functional/download_models.py -d data -j tests/functional/public_scope.json -l

- name: Run test
run: |
Expand Down Expand Up @@ -213,7 +168,9 @@ jobs:
- name: Install dependencies
run: uv --directory model_api sync --locked --group tests --extra ovms --extra-index-url https://download.pytorch.org/whl/cpu

- *prepare-test-data
- name: Prepare test data
run: |
uv --directory model_api run python tests/functional/download_models.py -d data -j tests/functional/serving_scope.json -l

- name: serving_api
run: |
Expand All @@ -226,7 +183,6 @@ jobs:
pre-commit-result:
runs-on: ubuntu-latest
needs:
- accuracy-tests
- code_quality_checks
- unit-functional-tests
- serving_api-tests
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ Install only the subproject(s) you are working on. Each step is independent.
```bash
uvx pre-commit run --all-files
uv --directory model_api run pytest tests/unit
uv --directory model_api run python tests/accuracy/download_models.py -d data -j tests/precommit/public_scope.json -l
uv --directory model_api run python tests/functional/download_models.py -d data -j tests/functional/public_scope.json -l
uv --directory model_api run pytest --data=./data tests/functional
uv --directory model_api run python tests/accuracy/download_models.py -d data -j tests/accuracy/public_scope.json -l
uv --directory model_api run pytest --data=./data tests/accuracy/test_accuracy.py
uv --directory model_converter run model-converter examples/config.json --list
```

Expand Down
2 changes: 1 addition & 1 deletion model_api/examples/asynchronous_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ uv run python run.py <path_to_model> <path_to_image>

In the root directory of the repository:

- download sample models and images by running `uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l`
- download sample models and images by running `uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l`
- run the example with the following command: `uv run python examples/asynchronous_api/run.py data/otx_models/ssd-card-detection.xml data/cards.png`
2 changes: 1 addition & 1 deletion model_api/examples/metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ uv run python benchmark.py --help

In the root directory of the repository:

- download sample models and images by running `uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l`
- download sample models and images by running `uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l`
- run the example with the following command: `uv run python examples/metrics/benchmark.py data/otx_models/ssd-card-detection.xml data/coco128/images/train2017`

## Expected Output
Expand Down
2 changes: 1 addition & 1 deletion model_api/examples/serving_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This example demonstrates how to use a Python API of OpenVINO Model API for a re

- Install Docker. Please refer to the [official documentation](https://docs.docker.com/get-docker/) for details.

- Download sample models and images by running `uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l` and resave a configured model at OVMS friendly folder layout:
- Download sample models and images by running `uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l` and resave a configured model at OVMS friendly folder layout:

```bash
mkdir -p data/ovms/ssd-card-detection/1
Expand Down
2 changes: 1 addition & 1 deletion model_api/examples/visual_prompting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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
uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l
uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l
```

and then run
Expand Down
2 changes: 1 addition & 1 deletion model_api/examples/visualization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ uv run python run.py --image <path_to_image> --model <path_to_model>.xml --outpu
To run the pipeline out-of-the box you can download the test data by running the following command from the repo root:

```bash
uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l
uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l
```

and then run
Expand Down
2 changes: 1 addition & 1 deletion model_api/examples/zsl_visual_prompting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Higher thresholds leads to lower mask recall in the final prediction, i.e. low c
To run the pipeline out-of-the box you can download the test data by running the following command from the repo root:

```bash
uv run python tests/accuracy/download_models.py -d data -j tests/accuracy/examples.json -l
uv run python tests/functional/download_models.py -d data -j tests/functional/examples.json -l
```

and then run
Expand Down
2 changes: 0 additions & 2 deletions model_api/tests/accuracy/__init__.py

This file was deleted.

55 changes: 0 additions & 55 deletions model_api/tests/accuracy/conftest.py

This file was deleted.

160 changes: 0 additions & 160 deletions model_api/tests/accuracy/test_YOLOv8.py

This file was deleted.

Loading