This commit is contained in:
SeongUk Han (luke.s) 2023-12-29 20:06:16 +00:00 committed by GitHub
commit eb9f1fbdd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,8 @@ absl::Status TopKScoresCalculator::GetContract(CalculatorContract* cc) {
} }
absl::Status TopKScoresCalculator::Open(CalculatorContext* cc) { absl::Status TopKScoresCalculator::Open(CalculatorContext* cc) {
cc->SetOffset(mediapipe::TimestampDiff(0));
const auto& options = cc->Options<::mediapipe::TopKScoresCalculatorOptions>(); const auto& options = cc->Options<::mediapipe::TopKScoresCalculatorOptions>();
RET_CHECK(options.has_top_k() || options.has_threshold()) RET_CHECK(options.has_top_k() || options.has_threshold())
<< "Must specify at least one of the top_k and threshold fields in " << "Must specify at least one of the top_k and threshold fields in "