refer to https://github.com/jkjung-avt/tensorrt_demos & https://jkjung-avt.github.io/jetpack-4.4/ ### Step 1 ### ### Download yolo model $ cd /home/adlink/Downloads/tensorrt_demos/yolo $ ./download_yolo.sh ### Step 2 ### ### Convert yolo model to ONNX $ cd /home/adlink/Downloads/tensorrt_demos/yolo $ python3 yolo_to_onnx.py -m yolov3-416 --category_num 80 ### Step 3 ### ### Optimize onnx model by TensorRT (takes about 4 minutes) ### yolov3-416 FP32 $ /usr/src/tensorrt/bin/trtexec --onnx=yolov3-416.onnx --workspace=3000 --maxBatch=4 --verbose --saveEngine=yolov3-416-fp32.engine ### Optional ### ### Optimize onnx model by TensorRT (takes about 14 minutes) ### yolov3-416 FP16 $ /usr/src/tensorrt/bin/trtexec --onnx=yolov3-416.onnx --workspace=3000 --maxBatch=4 --fp16 --verbose --saveEngine=yolov3-416-fp16.engine ### Optional ### ### Step 4 ### ### Test by EVA ### yolov3-416 FP16 $ gst-launch-1.0 pylonsrc camera=0 fps=11 ! videoconvert ! adrt model=~/Downloads/tensorrt_demos/yolo/yolov3-416-fp16.engine scale=0.004 mean="0 0 0" device=0 batch=1 ! adtranslator label=~/Desktop/EVA_IDE/model/yolo_RT_labels.txt topology=yolov3 dims=1,255,13,13,1,255,26,26,1,255,52,52 input_width=416 engine-type=2 ! admetadrawer ! videoconvert ! fpsdisplaysink video-sink=xvimagesink text-overlay=true ### yolov3-416 fp32 gst-launch-1.0 pylonsrc camera=0 fps=6 ! videoconvert ! adrt model=~/Downloads/tensorrt_demos/yolo/yolov3-416-fp32.engine scale=0.004 mean="0 0 0" device=0 batch=1 ! adtranslator label=~/Desktop/EVA_IDE/model/yolo_RT_labels.txt topology=yolov3 dims=1,255,13,13,1,255,26,26,1,255,52,52 input_width=416 engine-type=2 ! admetadrawer ! videoconvert ! fpsdisplaysink video-sink=xvimagesink text-overlay=true ### Optional ### If class trained by 2, input size=416x416 ### model name: yolov3-416_test.engine, label files: label.txt $ python3 yolo_to_onnx.py -m yolov3-416 --category_num 2 $ /usr/src/tensorrt/bin/trtexec --onnx=yolov3-416.onnx --workspace=3000 --maxBatch=4 --verbose --saveEngine=yolov3-416_test.engine $ gst-launch-1.0 pylonsrc camera=0 fps=6 ! videoconvert ! adrt model=yolov3-416_test.engine scale=0.004 mean="0 0 0" device=0 batch=1 ! adtranslator label=label.txt topology=yolov3 dims=1,21,13,13,1,21,26,26,1,21,52,52 input_width=416 engine-type=2 ! admetadrawer ! videoconvert ! xvimagesink sync=false