From 0913107fe724ec31690150644ce0cff71a9c7ecd Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 28 Dec 2022 09:16:40 +0900 Subject: [PATCH] fix: add missing SetOffset(0) to TopKScoresCalculator that causes real-time graphs to freeze --- mediapipe/calculators/util/top_k_scores_calculator.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediapipe/calculators/util/top_k_scores_calculator.cc b/mediapipe/calculators/util/top_k_scores_calculator.cc index b6bdf2f85..e613d3bbc 100644 --- a/mediapipe/calculators/util/top_k_scores_calculator.cc +++ b/mediapipe/calculators/util/top_k_scores_calculator.cc @@ -108,6 +108,8 @@ absl::Status TopKScoresCalculator::GetContract(CalculatorContract* cc) { } absl::Status TopKScoresCalculator::Open(CalculatorContext* cc) { + cc->SetOffset(mediapipe::TimestampDiff(0)); + const auto& options = cc->Options<::mediapipe::TopKScoresCalculatorOptions>(); RET_CHECK(options.has_top_k() || options.has_threshold()) << "Must specify at least one of the top_k and threshold fields in "