[micro_wake_word] avoid duplicated detections from same event (#8877)

This commit is contained in:
Kevin Ahrendt 2025-05-22 14:19:16 -05:00 committed by GitHub
parent 69da17742f
commit c23ea384fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -147,8 +147,12 @@ bool StreamingModel::perform_streaming_inference(const int8_t features[PREPROCES
this->recent_streaming_probabilities_[this->last_n_index_] = output->data.uint8[0]; // probability;
this->unprocessed_probability_status_ = true;
}
if (this->recent_streaming_probabilities_[this->last_n_index_] < this->probability_cutoff_) {
// Only increment ignore windows if less than the probability cutoff; this forces the model to "cool-off" from a
// previous detection and calling ``reset_probabilities`` so it avoids duplicate detections
this->ignore_windows_ = std::min(this->ignore_windows_ + 1, 0);
}
}
return true;
}