wang-xinyu / tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API
MIT License
6.93k stars 1.77k forks source link

Steps to use serialized engine in Deepstream Yolov5 #1224

Closed Alberto1404 closed 1 year ago

Alberto1404 commented 1 year ago

Hi @wang-xinyu. First of all thank you for your impressive work done in this repo. I would like to know if it is possible to use that engine in Deepstream. if so, it would be nice to know the steps to use the engine file from this repo in Deepstream. I followed all your steps generating the engine yolov5n.engine as follows: ./yolov5_det -s yolov5n.wts yolov5n.engine n

And I get as shown in the figure examp

For Deepstream we need this config_infer_primary_yolov5.txt:

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
custom-network-config=??
model-file=path/to/output/of/gen_wts_.py/yolov5n.wts??
model-engine-file=model_b4_gpu0_int8.engine # Changed name of my output after running command from above
int8-calib-file=in8tcalib.table
labelfile-path=labels.txt
batch-size=4
network-mode=0
num-detected-classes=1
interval=0
gie-unique-id=1
process-mode=1
network-type=0
cluster-mode=2
maintain-aspect-ratio=1
symmetric-padding=1
parse-bbox-func-name=NvDsInferParseYolo ##CORRECT?
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so ## SHOULDN'T IT BE libmyplugins.so?
engine-create-func-name=NvDsInferYoloCudaEngineGet ##CORRECT?

[class-attrs-all] ## These attributes should be neccesary? We have defined the thresholds in src/config.h before
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300

The doubts are marked with ''##'' in the txt file from above. Thank you in advance.

wang-xinyu commented 1 year ago

You can refer to this repo https://github.com/DanaHan/Yolov5-in-Deepstream-5.0

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.