-
Notifications
You must be signed in to change notification settings - Fork 133
docker镜像子项目《deepstream_yolov5》两种引擎(engine)生成方式
jianyang edited this page Feb 10, 2022
·
1 revision
1.对于CDR-jetson镜像,在root目录下有yolov5源码项目,yolov5文件夹内有gen_wts_yoloV5.py
文件,执行如下命令可生成yolov5s.cfg
和yolov5s.wts
两个文件:
python3 gen_wts_yoloV5.py -w yolov5s.pt
2.将以上生成的两个文件yolov5s.cfg
和yolov5s.wts
复制到/opt/nvidia/deepstream/deepstream-6.0/sources/deepstream_python_apps/apps/deepstream-yolov5
文件夹下,该文件夹下config_infer_primary.txt
文件内容改成如下所示:
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
custom-network-config=yolov5s.cfg
model-file=yolov5s.wts
model-engine-file=model_b1_gpu0_fp32.engine
labelfile-path=labels.txt
batch-size=1
network-mode=0
num-detected-classes=80
interval=0
gie-unique-id=1
process-mode=1
network-type=0
cluster-mode=4
maintain-aspect-ratio=1
parse-bbox-func-name=NvDsInferParseYolo
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet
[class-attrs-all]
pre-cluster-threshold=0.25
python3 deepstream_yolov5_file.py file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_qHD.h264