January 29th, 2022
The whole code is available at here.
After completing the Tensor-RT's Complete Inference, you will probably start itching to do some real stuff, aren't you? Btw, the webcam implementation is available at *onnx_trt_webcam.py*
What will be required in here:
Well, That’s all you need!
Tensor-RT (abbrev. TRT)
ONNX-Runtime (abbrev. ORT)
For the implementation parts. I will separate the process into:
As I mentioned in my previous post, the winner of this test is Tensor-RT FP16 with ~17ms. In this test, the speed rank is also similar (TRT FP16 > TRT FP32 > ORT FP32 > ORT FP16). The difference is that the speed with TRT-FP16 is slightly slower when I tested it in using the WebcamViewer code.
Here are some snapshot between ONNX FP32 vs ONNX FP16 vs Tensor-RT FP32 vs Tensor-RT FP16.
| ONNX FP32 | ONNX FP16 |
|---|---|
| Tensor-RT FP32 | Tensor-RT FP16 |
As you can see, the models havbe is as the following:
In summary, the streaming speed using the Webcam Viewer script is as follow:
For starter, you can use this command to check the available options.
git clone my github (briliantnugraha.github.io)
cd ./all_rt/webcam_ort_trt
python ./codes/onnx_trt_yolox_webcam.py -h
And these are the command that I use to reproduce the streaming results (ORT and TRT)
python ./codes/onnx_trt_yolox_webcam.py --model_path "F:/gitdata/test_trt/yolox_m.trt" --rtsp_url "http://gyofarras:gyofarras@192.168.1.101:4747/video" #TRT-FP32
python ./codes/onnx_trt_yolox_webcam.py --model_path \"F:/gitdata/test_trt/yolox_m16.trt\" --rtsp_url \"http://gyofarras:gyofarras@192.168.1.101:4747/video" #TRT-FP16
python ./codes/onnx_trt_yolox_webcam.py --model_path \"F:/gitdata/test_trt/yolox_m.onnx\" --rtsp_url \"http://gyofarras:gyofarras@192.168.1.101:4747/video" #ORT-FP32
python ./codes/onnx_trt_yolox_webcam.py --model_path "F:/gitdata/test_trt/yolox_m16.onnx" --rtsp_url "http://gyofarras:gyofarras@192.168.1.101:4747/video" #ORT-FP16
Hope this explanation helps. If there is any question or mistake with the content, please don’t hesitate to let me know, see you in the next blog and stay safe!