-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
152 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,47 @@ | ||
# Dependencies # | ||
# sample deploy app using onnxruntime # | ||
*** | ||
|
||
## Dependencies ## | ||
*** | ||
|
||
- [onnxruntime](https://github.com/microsoft/onnxruntime) | ||
* tested with v1.10.0 | ||
* to build onnxruntime from source you need cmake>=3.18 | ||
* you can build from source with the [build script](https://github.com/microsoft/onnxruntime/blob/master/build.sh) | ||
* you can also build docker environment for testing using dockerfiles from [here](https://github.com/microsoft/onnxruntime/tree/master/dockerfiles) | ||
* here is the sample procedure to build cpu onnxruntime | ||
```bash | ||
readonly ONNXRUNTIME_VERSION="v1.10.0" | ||
git clone --recursive -b ${ONNXRUNTIME_VERSION} https://github.com/Microsoft/onnxruntime | ||
./build.sh --config RelWithDebInfo --build_shared_lib --skip_tests --parallel `nproc` | ||
cd build/Linux/RelWithDebInfo | ||
make install | ||
``` | ||
|
||
- opencv | ||
```bash | ||
sudo apt-get install libopencv-dev | ||
``` | ||
|
||
# How to Run # | ||
## How to Build ## | ||
*** | ||
```bash | ||
mkdir build && cd build && cmake ../ && make -j`nproc` | ||
``` | ||
|
||
- Download test images | ||
## How to Run ## | ||
*** | ||
|
||
- Download test images | ||
```bash | ||
wget https://paddleseg.bj.bcebos.com/dygraph/demo/cityscapes_demo.png | ||
``` | ||
|
||
- Export PaddleSeg Model to onnx format | ||
* [export PaddleSeg model](https://github.com/PaddlePaddle/PaddleSeg/blob/develop/docs/model_export.md) | ||
* convert exported model to onnx format with [Paddle2ONNX](https://github.com/PaddlePaddle/Paddle2ONNX) | ||
|
||
- Run app | ||
|
||
```bash | ||
./build/onnxruntime_cpp_inference_demo_app /path/to/test/image /path/to/onnx/model | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters