Skip to content

Commit

Permalink
Add pre-processing in PredictorTRT pipeline (#309)
Browse files Browse the repository at this point in the history
* Add pre-processing transform in PredictorTRT

* Remove img_size parameters in PredictorTRT.warmup

* Fixing device and dtype setting

* Fixing inference pipeline

* Minor fixes

* Update tutorials

* Update README for TensorRT deploy pipeline

* Apply pre-commit

* Add Examples
  • Loading branch information
zhiqwang authored Feb 11, 2022
1 parent 720cd32 commit c4fbbe1
Show file tree
Hide file tree
Showing 5 changed files with 388 additions and 293 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,21 @@ On the `ONNX Runtime` front you can use the [C++ example](deployment/onnxruntime

### Inference on TensorRT backend

The pipeline for TensorRT deployment is also very easy to use.

```python
import torch
from yolort.runtime import PredictorTRT

# Load the exported TensorRT engine
engine_path = "yolov5n6.engine"
device = torch.device("cuda")
y_runtime = PredictorTRT(engine_path, device=device)

# Perform inference on an image file
predictions = y_runtime.predict("bus.jpg")
```

On the `TensorRT` front you can use the [C++ example](deployment/tensorrt), and we also provide a [tutorial](https://zhiqwang.com/yolov5-rt-stack/notebooks/onnx-graphsurgeon-inference-tensorrt.html) for using the `TensorRT`.

## 🎨 Model Graph Visualization
Expand Down
Loading

0 comments on commit c4fbbe1

Please sign in to comment.