I have a custom 3-class object detection model.
.pt → works fine, all 3 classes detected correctly.
Converted to ONNX → still works fine, correct detections for all 3 classes.
Integrated into DeepStream pipeline and generated an engine (.engine) file from the ONNX.
Problem:
When running inference with the engine file in DeepStream, it only outputs detections for a single class — specifically, the one that appears first in my labels file. All detected objects are being assigned this same class, even though visually they belong to different classes.
Notes:
The .pt and .onnx models are working correctly outside DeepStream.
The DeepStream configuration (labels.txt, num-detected-classes, etc.) seems correct.
The issue only happens after TensorRT engine generation in DeepStream.
Has anyone faced this issue before? Any suggestions on what to check.
config file :—
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
onnx-file=../../../surveillance_ai_model/x86_64/Person_Vehicle_Detection/VehicleDetection_V1.9_YOLOn640.onnx
model-engine-file=../../../surveillance_ai_model/x86_64/Person_Vehicle_Detection/VehicleDetection_V1.9_YOLOn640.onnx_b1_fp32.engine
labelfile-path=../../../surveillance_ai_model/x86_64/Person_Vehicle_Detection/labels.txt
infer-dims=3;640;640
uff-input-blob-name=input
cluster-mode=3
batch-size=4
network-mode=0
process-mode=1
model-color-format=0
num-detected-classes=3
interval=0
gie-unique-id=1
#output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid
#output-blob-names=output_bbox/BiasAdd;output_cov/Sigmoid
#output-blob-names=output_bbox;output_cov
output-blob-names=output
#use-gpu-preprocess=1
enable_vic=0
Minimum object filtering
input-object-min-width=40
input-object-min-height=30
enable-dla=1
Force GPU scaling to avoid VIC limit
scaling-compute-hw=0
parse-bbox-func-name=NvDsInferParseYolo
custom-lib-path=/home/smarg/DeepStream-Yolo/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
min-box-width=30
min-box-height=30
max-box-width=1920
max-box-height=1080
[class-attrs-0]
#detected-min-w=50
#detected-min-h=50
pre-cluster-threshold=0.10
eps=0.7
minBoxes=1
group-threshold=1
#bbox-border-color=0;1;0;0.3
[class-attrs-1]
pre-cluster-threshold=0.20
eps=0.7
minBoxes=1
group-threshold=1
#bbox-border-color=0;1;0;0.3
[class-attrs-2]
pre-cluster-threshold=0.10
eps=0.7
minBoxes=1
group-threshold=1
#bbox-border-color=0;1;0;0.3