使用 nvidia deep stream - 推理引擎,无法获得分类器类。它总是显示索引 0。任何帮助表示赞赏。
l_classifier = obj_meta.classifier_meta_list
print('First Classifier at: ', l_classifier)
classifier_cnt = 0
while l_classifier is not None:
classifier_cnt += 1
print('Parsing Classifier at: ', l_classifier)
try:
classifier_meta = pyds.glist_get_nvds_classifier_meta(
l_classifier.data)
print('Classifier Component ID:' + str(classifier_meta.unique_component_id))
# nxt_classifier = classifier_meta.next
# print(nxt_classifier)
# print(dir(classifier_meta))
except Exception as ex:
print('Could not parse MetaData: ', ex)
l_label = classifier_meta.label_info_list
uid=classifier_meta.unique_component_id
numLabel=classifier_meta.num_labels
classId = classifier_meta.class_id
label_info=pyds.glist_get_nvds_label_info(l_label.data)
classifier_class = label_info.result_class_id
num_classes = label_info.num_classes
label_id = label_info.label_id
result_prob = label_info.result_prob
print("1 l_label :",l_label)
print("1 u id ------------ :",uid)
print("1 numLabel :",numLabel)
print("1 label_info :",label_info)
print("1 classifier_class:",classifier_class)
print("1 num_classes :",num_classes)
print("1 label_id :",label_id)
print("classId ==>", classId)
l_classifier = l_classifier.next
print('Next Classifier: ', l_classifier)
样本输出为
1 l_label : <pyds.GList object at 0x7fa740cfcf80>
1 u id ------------ : 4
1 numLabel : 1
1 label_info : <pyds.NvDsLabelInfo object at 0x7fa740cfcf48>
1 classifier_class: 0
1 num_classes : 0
1 label_id : 0
分类器类始终显示为 0