From 9eceb24a649c8dbffe57cb71e6f112569fb7bb27 Mon Sep 17 00:00:00 2001 From: Yu-Cheng Ling Date: Fri, 26 Apr 2019 16:02:25 -0700 Subject: [PATCH] TFLite micro: Fix/improve suppression logic in speech example PiperOrigin-RevId: 245503306 --- .../micro/examples/micro_speech/recognize_commands.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/experimental/micro/examples/micro_speech/recognize_commands.cc b/tensorflow/lite/experimental/micro/examples/micro_speech/recognize_commands.cc index 8187962c3e7..8cc7e2eeb9a 100644 --- a/tensorflow/lite/experimental/micro/examples/micro_speech/recognize_commands.cc +++ b/tensorflow/lite/experimental/micro/examples/micro_speech/recognize_commands.cc @@ -124,8 +124,8 @@ TfLiteStatus RecognizeCommands::ProcessLatestResults( time_since_last_top = current_time_ms - previous_top_label_time_; } if ((current_top_score > detection_threshold_) && - (current_top_label != previous_top_label_) && - (time_since_last_top > suppression_ms_)) { + ((current_top_label != previous_top_label_) || + (time_since_last_top > suppression_ms_))) { previous_top_label_ = current_top_label; previous_top_label_time_ = current_time_ms; *is_new_command = true;