-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (77 loc) · 2.51 KB
/
Copy pathci.yml
File metadata and controls
85 lines (77 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install package
run: python -m pip install --upgrade pip && python -m pip install .
- name: Verify installed native package
working-directory: ${{ runner.temp }}
run: |
python - <<'PY'
import numpy as np
from fastvisionops import NativeBackend
backend = NativeBackend()
assert backend.library_path.name.startswith("_native")
np.testing.assert_array_equal(
backend.nms(
[[0, 0, 10, 10], [1, 1, 9, 9], [20, 20, 30, 30]],
[0.9, 0.8, 0.7],
),
[0, 2],
)
output = backend.hwc_to_chw_normalize(
np.zeros((4, 5, 3), dtype=np.uint8),
[0, 0, 0],
[1, 1, 1],
threads=2,
)
assert output.shape == (3, 4, 5)
PY
- name: Build native backend
run: python -m fastvisionops.build
- name: Verify portable native build
run: |
python -m fastvisionops.build \
--no-openmp \
--output "${RUNNER_TEMP}/libfastvisionops-portable.so"
python - <<'PY'
import os
import numpy as np
from fastvisionops import NativeBackend
backend = NativeBackend(
os.path.join(
os.environ["RUNNER_TEMP"],
"libfastvisionops-portable.so",
)
)
np.testing.assert_array_equal(
backend.nms(
[[0, 0, 10, 10], [1, 1, 9, 9], [20, 20, 30, 30]],
[0.9, 0.8, 0.7],
),
[0, 2],
)
PY
- name: Run test suite
run: python -m unittest discover -s tests -v
- name: Smoke-test benchmark runners
run: |
python -m benchmarks.benchmark_bbox --sizes 16 64 --warmup 0 --repeats 1 --batch-size 2 --batch-boxes 32 --workers 2 --format json
python -m benchmarks.benchmark_preprocess --batches 1 2 --height 32 --width 32 --warmup 0 --repeats 1 --threads 2 --format json