diff --git a/tensorflow/lite/micro/kernels/detection_postprocess.cc b/tensorflow/lite/micro/kernels/detection_postprocess.cc index cdf86349ed2..63ace6049e4 100644 --- a/tensorflow/lite/micro/kernels/detection_postprocess.cc +++ b/tensorflow/lite/micro/kernels/detection_postprocess.cc @@ -357,8 +357,9 @@ int SelectDetectionsAboveScoreThreshold(const float* values, int size, int counter = 0; for (int i = 0; i < size; i++) { if (values[i] >= threshold) { - keep_values[counter++] = values[i]; - keep_indices[i] = i; + keep_values[counter] = values[i]; + keep_indices[counter] = i; + counter++; } } return counter;