-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete TensorRT C++ example! (#257)
* Update TRT inference examples * Save image instead of show image * Add readme
- Loading branch information
Showing
2 changed files
with
136 additions
and
41 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# TensorRT Inference | ||
|
||
The TensorRT inference for `yolort`, support GPU only. | ||
|
||
## Dependencies | ||
|
||
- TensorRT 8.x | ||
|
||
## Usage | ||
|
||
1. Create build director and cmake config. | ||
|
||
```bash | ||
mkdir -p build/ && cd build/ | ||
cmake .. -DTENSORRT_DIR=${your_trt_install_director} | ||
``` | ||
|
||
1. Build project | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
1. Export your custom model to ONNX(see [onnx-graphsurgeon-inference-tensorrt](https://github.com/zhiqwang/yolov5-rt-stack/blob/main/notebooks/onnx-graphsurgeon-inference-tensorrt.ipynb)). | ||
|
||
1. Now, you can infer your own images. | ||
|
||
```bash | ||
./yolort_trt [--image ../../../test/assets/zidane.jpg] | ||
[--model_path ../../../notebooks/yolov5s.onnx] | ||
[--class_names ../../../notebooks/assets/coco.names] | ||
[--fp16] # Enable it if your GPU support fp16 inference | ||
``` |
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