0
点赞
收藏
分享

微信扫一扫

nvinfer配置参数模板

0. 背景介绍

当使用deepstream进行模型推理,经常需要配置nvinfer的参数,但是参数含义却难以记住,因此按照,一级目标检测,二级目标检测和二级目标分类这三个场景编写了一个参数模板,之后只需复制这个模板对其中的参数进行修改即可。

参考链接:Gst-nvinfer — DeepStream 6.0 Release documentation (nvidia.com)

1. primary detector之nvinfer config参数模板

[property]
# 1. image preprocess
# variance
net-scale-factor=0.0039215697906911373
# Integer 0: RGB 1: BGR 2: GRAY
model-color-format=0
# aspect ratio
maintain-aspect-ratio=1
# resize interploation 
scaling-filter=1
# Compute hardware to use for scaling frames / object crops to network resolution
scaling-compute-hw=0
# Indicates whether to pad image symmetrically while scaling input.
symmetric-padding=1

# 2. build network
force-implicit-batch-dim=1
batch-size=16
# model file
model-file=../../models/Primary_Detector/resnet10.caffemodel
proto-file=../../models/Primary_Detector/resnet10.prototxt
# build engine
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine
# label file
labelfile-path=../../models/Primary_Detector/labels.txt
int8-calib-file=../../models/Primary_Detector/cal_trt.bin
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=1
# Infer Processing Mode 1=Primary Mode 2=Secondary Mode
process-mode=1
# Number of classes detected by the network (Detector)
num-detected-classes=4
# output layer name
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid

# 3. post-preprocess function
## 1=DBSCAN, 2=NMS, 3= DBSCAN+NMS Hybrid, 4 = None(No clustering)
cluster-mode=4
# parse-bbox-func-name=NvDsInferParseCustomResnet
# custom-lib-path=/path/to/libnvdsparsebbox.so

# 4.  Gst Properties
# Device ID of GPU to use for pre-processing/inference (dGPU only)
gpu-id=0
# Unique ID identifying metadata generated by this GIE
gie-unique-id=1
# Number of consecutive batches to be skipped for inference
interval=0


[class-attrs-all]
# Detection threshold to be applied prior to clustering operation(NMS)
pre-cluster-threshold=0.2
# Maximum IOU score between two proposals after which the proposal with the lower confidence will be rejected.
nms-iou-threshold=0.5
# Detection threshold to be applied post clustering operation
post-cluster-threshold=0.5

2. secondary detector配置参数模板

[property]
# 1. image preprocess
# variance
net-scale-factor=0.0039215697906911373
# Integer 0: RGB 1: BGR 2: GRAY
model-color-format=0
# aspect ratio
maintain-aspect-ratio=1
# resize interploation 
scaling-filter=1
# Compute hardware to use for scaling frames / object crops to network resolution
scaling-compute-hw=0
# Indicates whether to pad image symmetrically while scaling input.
symmetric-padding=1

# 2. build network
force-implicit-batch-dim=1
batch-size=16
# model file
model-file=../../models/Primary_Detector/resnet10.caffemodel
proto-file=../../models/Primary_Detector/resnet10.prototxt
# build engine
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine
# label file
labelfile-path=../../models/Primary_Detector/labels.txt
int8-calib-file=../../models/Primary_Detector/cal_trt.bin
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=1
# Infer Processing Mode 1=Primary Mode 2=Secondary Mode
process-mode=2
# Integer 0: Detector  1: Classifier
network-type=0
# Number of classes detected by the network (Detector)
num-detected-classes=4
# output layer name
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid

# 3. post-preprocess function
## 1=DBSCAN, 2=NMS, 3= DBSCAN+NMS Hybrid, 4 = None(No clustering)
cluster-mode=4
parse-bbox-func-name=NvDsInferParseCustomResnet
custom-lib-path=/path/to/libnvdsparsebbox.so

# 4.  Gst Properties
# Device ID of GPU to use for pre-processing/inference (dGPU only)
gpu-id=0
# Unique ID identifying metadata generated by this GIE
gie-unique-id=2
# Number of consecutive batches to be skipped for inference
interval=0

# 5. secondary detector

# Secondary GIE infers only on objects with this minimum height and width
input-object-min-width=24
input-object-min-height=24
# Unique ID of the GIE on whose metadata (bounding boxes) this GIE is to operate on
operate-on-gie-id=1
# Class IDs of the parent GIE on which this GIE is to operate on
operate-on-class-ids=2

[class-attrs-all]
# Detection threshold to be applied prior to clustering operation(NMS)
pre-cluster-threshold=0.2
# Maximum IOU score between two proposals after which the proposal with the lower confidence will be rejected.
nms-iou-threshold=0.5
# Detection threshold to be applied post clustering operation
post-cluster-threshold=0.5

3. secondary classifier配置模板

[property]
# 1. image preprocess
# variance
net-scale-factor=0.0039215697906911373
# Integer 0: RGB 1: BGR 2: GRAY
model-color-format=0
# aspect ratio
maintain-aspect-ratio=1
# resize interploation 
scaling-filter=1
# Compute hardware to use for scaling frames / object crops to network resolution
scaling-compute-hw=0
# Indicates whether to pad image symmetrically while scaling input.
symmetric-padding=1

# 2. build network
force-implicit-batch-dim=1
batch-size=16
# model file
model-file=../../models/Primary_Detector/resnet10.caffemodel
proto-file=../../models/Primary_Detector/resnet10.prototxt
# build engine
model-engine-file=../../models/Primary_Detector/resnet10.caffemodel_b30_gpu0_int8.engine
# label file
labelfile-path=../../models/Primary_Detector/labels.txt
int8-calib-file=../../models/Primary_Detector/cal_trt.bin
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=0
# Infer Processing Mode 1=Primary Mode 2=Secondary Mode
process-mode=2
# Integer 0: Detector  1: Classifier
network-type=1
is-classifier=1
# Number of classes detected by the network (classifier)
num-detected-classes=4
# output layer name
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid

# 3. post-preprocess function
## 1=DBSCAN, 2=NMS, 3= DBSCAN+NMS Hybrid, 4 = None(No clustering)
cluster-mode=4
parse-bbox-func-name=NvDsInferParseCustomResnet
custom-lib-path=/path/to/libnvdsparsebbox.so

classifier-threshold=0.51

# 4.  Gst Properties
# Device ID of GPU to use for pre-processing/inference (dGPU only)
gpu-id=0
# Unique ID identifying metadata generated by this GIE
gie-unique-id=2
# Number of consecutive batches to be skipped for inference
interval=0

# 5. secondary detector

# Secondary GIE infers only on objects with this minimum height and width
input-object-min-width=24
input-object-min-height=24
# Unique ID of the GIE on whose metadata (bounding boxes) this GIE is to operate on
operate-on-gie-id=1
# Class IDs of the parent GIE on which this GIE is to operate on
operate-on-class-ids=2
举报

相关推荐

0 条评论