模型地址:https://catalog.ngc.nvidia.com/orgs/nvidia/teams/tao/models/trafficcamnet/version
目前模型是nvidia的加密格式etlt。
nvinfer的配置
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
tlt-model-key=tlt_encode
tlt-encoded-model=trafficcamnet/resnet18_trafficcamnet_pruned.etlt
labelfile-path=labels_trafficnet.txt
int8-calib-file=trafficcamnet/trafficnet_int8.txt
model-engine-file=trafficcamnet/resnet18_trafficcamnet_pruned.etlt_b4_gpu0_int8.engine
input-dims=3;544;960;0
uff-input-blob-name=input_1
batch-size=4
process-mode=1
model-color-format=0
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=1
num-detected-classes=4
interval=0
gie-unique-id=1
output-blob-names=output_bbox/BiasAdd;output_cov/Sigmoid[class-attrs-all]
pre-cluster-threshold=0.2
group-threshold=1
## Set eps=0.7 and minBoxes for cluster-mode=1(DBSCAN)
eps=0.2
#minBoxes=3
测试图片:/opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.jpg
测试命令:
gst-launch-1.0 filesrc location=sample_720p.jpg ! jpegdec ! videoconvert ! video/x-raw,format=I420 ! nvvideoconvert ! video/x-raw\(memory:NVMM\),format=NV12 ! mux.sink_0 nvstreammux name=mux batch-size=1 width=1280 height=720 ! nvinfer config-file-path=./trafficamnet_config.txt ! nvvideoconvert ! video/x-raw\(memory:NVMM\),format=RGBA ! nvdsosd ! nvvideoconvert ! video/x-raw,format=I420 ! jpegenc ! filesink location=out.jpg
测试结果: