deepstream_lpr_app
deepstream_lpr_app copied to clipboard
Fix wrong confidence values
Confidence is currently transferred from TensorRT network to Deepstream in a wrong way, resulting in random values.
The LPR network has two output layers:
1 OUTPUT kINT32 tf_op_layer_ArgMax 24
2 OUTPUT kFLOAT tf_op_layer_Max 24
The first is a 24x1 vector that contains detected characters, the second is a 24x1 vector that contains the confidence of each detected character.
At the moment, confidence of each detected character is extracted by using the detected character as key to the confidence vector.
int curr_data = outputStrBuffer[seq_id];
...
bank_softmax_max[valid_bank_count] = outputConfBuffer[curr_data];
i.e., if the 2nd element of the detection vector is character 'Z', that is the 34th character listed in the dict file, its confidence is assumed to be the 34th element of the confidence vector (that doesn't even exist), while it should be the one correspondent to the order in which the character was detected (in this case the 2nd element of the confidence vector).
This should be:
int curr_data = outputStrBuffer[seq_id];
...
bank_softmax_max[valid_bank_count] = outputConfBuffer[seq_id];
This patch fixes the issue.
+1. Not sure why this hasn't been merged yet. I'll post over in their developer forum to see if we can bring some attention to this.
@Lexmark-chad Any updates? -- disregard
This PR seems like it can be closed without merge as the change has organically been introduced by the team https://github.com/NVIDIA-AI-IOT/deepstream_lpr_app/blob/master/nvinfer_custom_lpr_parser/nvinfer_custom_lpr_parser.cpp#L124
:+1: