You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-35Lines changed: 14 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,21 @@ Python version of the OpenPTV library - this is *a work in progress*
7
7
`openptv-python` keeps the Python API as the main interface and combines three
8
8
execution modes behind that API:
9
9
10
-
- Pure Python: the reference implementation and the easiest path for reading,
11
-
debugging, and extending the code.
12
-
- Python + Numba: several hot kernels are JIT-compiled automatically on first
10
+
-**Pure Python**: the reference implementation and the easiest path for reading,
11
+
debugging, and extending the code. Always available as fallback.
12
+
-**Python + Numba**: several hot kernels are JIT-compiled automatically on first
13
13
use, so the Python implementation still benefits from acceleration.
14
-
- Native `optv` bindings: selected operations reuse the native OpenPTV
15
-
implementation when the `optv` package is available.
16
-
- PyPTV GUI: packaged in the same repository and installed as an optional
17
-
application package.
14
+
-**Native `optv` bindings** (default): selected operations reuse the native OpenPTV
15
+
implementation. Installed by default on supported platforms (Linux, macOS, Windows).
18
16
19
17
At the moment, automatic native delegation is implemented for image
20
18
preprocessing and full-frame target recognition. The rest of the library keeps
21
19
the same Python API and remains usable even when those native paths are not in
22
20
use.
23
21
22
+
If `optv` is not available on your platform, the package automatically falls back
23
+
to pure Python/Numba implementations without any configuration needed.
24
+
24
25
## How this is started
25
26
26
27
This work started from the https://github.com/OpenPTV/openptv/tree/pure_python branch. It now serves as the single repository for the Python core library and the GUI layer.
@@ -43,15 +44,7 @@ source .venv/bin/activate
43
44
uv sync
44
45
```
45
46
46
-
This gives you the standard runtime stack: NumPy, SciPy, Numba, and YAML
47
-
support.
48
-
49
-
If you also want native `optv` delegation when bindings are available for your
50
-
platform and Python version, install the optional extra:
51
-
52
-
```bash
53
-
uv sync --extra native
54
-
```
47
+
This gives you the standard runtime stack: NumPy, SciPy, Numba, YAML, and the native `optv` bindings for accelerated image preprocessing and target recognition.
55
48
56
49
If you also want the GUI application, install the GUI extra:
57
50
@@ -67,12 +60,6 @@ conda activate openptv-python
67
60
pip install .
68
61
```
69
62
70
-
Optional native bindings:
71
-
72
-
```bash
73
-
pip install ".[native]"
74
-
```
75
-
76
63
Optional GUI application:
77
64
78
65
```bash
@@ -99,14 +86,10 @@ pip install -e ".[dev]"
99
86
100
87
### What gets installed
101
88
102
-
- The default install contains the runtime dependencies only.
103
-
- The optional `native` extra adds `optv` bindings for automatic native
104
-
delegation on supported platforms.
89
+
- The default install includes `optv` bindings for automatic native delegation on supported platforms (Linux, macOS, Windows).
105
90
- The optional `gui` extra adds the PyPTV GUI and its runtime dependencies.
106
-
- The optional `dev` extra adds test, docs, typing, pre-commit, and GUI
107
-
tooling for contributors.
108
-
- The public API stays the same regardless of which backend extras are
109
-
installed.
91
+
- The optional `dev` extra adds test, docs, typing, pre-commit, and GUI tooling for contributors.
92
+
- If `optv` fails to install on your platform, the package falls back to pure Python/Numba implementations automatically.
110
93
111
94
## Backend Behavior
112
95
@@ -161,13 +144,9 @@ Use one of the installation methods above.
161
144
uv run python - <<'PY'
162
145
import openptv_python
163
146
import numba
164
-
try:
165
-
import optv
166
-
except ImportError:
167
-
print("optv not installed; native delegation disabled")
0 commit comments