Secondary classifier data in Deepstream Python apps

How to get classifier data in deepstream python apps? I converted the LPR model from C to python and added these lines in the buffer probe function which enabled me to get the classifier data. But when I am doing the same for other secondary classifiers it is not working. like in test app 2 I am unable to get classifier data from this piece of code

       l_class = obj_meta.classifier_meta_list
       #print(l_class)

        while l_class is not None:
            try:
                class_meta = pyds.NvDsClassifierMeta.cast(l_class.data)
            except StopIteration:
                break

            l_label = class_meta.label_info_list
            # print(class_meta.num_labels)
            while l_label is not None:
                try:
                    label_info = pyds.NvDsLabelInfo.cast(l_label.data)
                except StopIteration:
                    break

                print(label_info.result_label)
                # print(long_to_int(obj_meta.object_id))
                x = obj_meta.rect_params.left
                y = obj_meta.rect_params.top
                w = obj_meta.rect_params.width
                h = obj_meta.rect_params.height
                lp_dict[frame_meta.pad_index][obj_meta.object_id] = [label_info.result_label, obj_meta.confidence, int(x), int(y), int(x+w), int(y+h)]
                try:
                    l_label=l_label.next
                except StopIteration:
                    break
            try:
                l_class=l_class.next
            except StopIteration:
                break

Hey,

  1. please share your setup with us
  2. Please share the configs file you are using

I am running test app 2 with only 1 secondary and the above piece of code in the buffer function. following is the secondary config.

[property]
gpu-id=0
net-scale-factor=1
model-file=./Secondary_CarColor/resnet18.caffemodel
proto-file=./Secondary_CarColor/resnet18.prototxt
model-engine-file=./Secondary_CarColor/resnet18.caffemodel_b16_gpu0_int8.engine
mean-file=./Secondary_CarColor/mean.ppm
labelfile-path=./Secondary_CarColor/labels.txt
int8-calib-file=./Secondary_CarColor/cal_trt.bin
force-implicit-batch-dim=1
batch-size=16

0=FP32 and 1=INT8 mode

network-mode=1
input-object-min-width=64
input-object-min-height=64
process-mode=2
model-color-format=1
gpu-id=0
gie-unique-id=2
operate-on-gie-id=1
operate-on-class-ids=0
is-classifier=1
output-blob-names=predictions/Softmax
classifier-async-mode=1
classifier-threshold=0.51

I solved it by removing the classifier-async-mode. I am getting classifier info for the caffemodel provided for test app 2. This worked because there was no tracker in my app.
But it is not working for vehicletypenet which is etlt with or without tracker.

This is the config for vehicletypenet as secondary:
[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
int8-calib-file=./vehicletypenet_int8.txt
labelfile-path=./labels_sgie.txt
tlt-encoded-model=./resnet18_vehicletypenet_pruned.etlt
tlt-model-key=tlt_encode
input-dims=3;224;224;0
uff-input-blob-name=input_1

batch-size=4

0=FP32, 1=INT8, 2=FP16 mode

network-mode=0
process-mode=2
model-color-format=0
#0:Detector, 1:Classifier, 2:Segmentation, 3:Instance Segmentation
network-type=1
gie-unique-id=2
operate-on-gie-id=1
operate-on-class-ids=0
#is-classifier=1
output-blob-names=predictions/Softmax
classifier-threshold = 0.3
#classifier-async-mode=1