Skip to content

Commit b805103

Browse files
committed
Add documentation for ONNX Runtime usage
The build process and demo depends on external ONNX Runtime. Existing documentation needed a fix and clarification.
1 parent ba6d6bb commit b805103

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples_onnx/README_python.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
TEN VAD Python ONNX example
22

33
This README describes linux build and demonstration of a Python extension
4-
module using Python bindings for TEN VAD C++/C source code and ONNX runtime.
4+
module using Python bindings for TEN VAD C++/C source code with external
5+
ONNX Runtime.
56

67
The build system is designed to work on these CPU architectures.
78
| Architecture | Notes |
@@ -39,6 +40,7 @@ curl -OL https://github.com/microsoft/onnxruntime/releases/download/v$ONNX_VER/o
3940
tar -xzf onnxruntime-linux-$ARCH-$ONNX_VER.tgz
4041
rm onnxruntime-linux-$ARCH-$ONNX_VER.tgz
4142
```
43+
The extracted ONNX Runtime folder is used for the following build and demo.
4244

4345
## 3. Build
4446

@@ -74,12 +76,6 @@ cd build-python
7476
python3 -c 'import sys; sys.path.insert(0, "lib"); import ten_vad_python; print("Import success!")'
7577
```
7678

77-
Remove ONNX Runtime folder (optional clean-up).
78-
```bash
79-
cd
80-
rm -rf onnxruntime-linux-$ARCH-$ONNX_VER
81-
```
82-
8379
## 4. Demo
8480

8581
Runs from the build directory. The demo requires `numpy`, which is already
@@ -104,6 +100,9 @@ Create a new folder and copy three artifacts.
104100
* `onnx_model/` folder from `src`
105101
* `ten_vad_demo.py` script from `examples_onnx`
106102

103+
Extract same version of ONNX Runtime to user's home folder (or different version
104+
and path you set with build script `--ort-path` option).
105+
107106
Run demo script with `pip install numpy`.
108107

109108
### Output comparison of Python extension module and compiled C
@@ -177,7 +176,8 @@ print(f"Is voice: {is_voice}")
177176
- `ten_vad_demo.py` - Python usage example
178177
- `ten_vad_python.cc` - pybind11 wrapper
179178

180-
Python usage example requires these files for ARM64 with Python 3.12.
179+
Python usage example `ten_vad_demo.py` requires the extracted ONNX Runtime
180+
folder and these files to run on Linux ARM64 with Python 3.12.
181181
```console
182182
examples_onnx/build-python
183183
├── lib

0 commit comments

Comments
 (0)