From 29484702cef7908881262579382f4f4f8055170f Mon Sep 17 00:00:00 2001 From: Jiuqiang Tang Date: Wed, 18 Jan 2023 08:00:48 -0800 Subject: [PATCH] Add `process_timestamp_bounds` into RectToRenderScaleCalculatorOptions. PiperOrigin-RevId: 502877541 --- mediapipe/calculators/util/rect_to_render_scale_calculator.cc | 4 +++- .../calculators/util/rect_to_render_scale_calculator.proto | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mediapipe/calculators/util/rect_to_render_scale_calculator.cc b/mediapipe/calculators/util/rect_to_render_scale_calculator.cc index 6ff6b3d5..85ed1db7 100644 --- a/mediapipe/calculators/util/rect_to_render_scale_calculator.cc +++ b/mediapipe/calculators/util/rect_to_render_scale_calculator.cc @@ -80,7 +80,9 @@ absl::Status RectToRenderScaleCalculator::GetContract(CalculatorContract* cc) { cc->Inputs().Tag(kNormRectTag).Set(); cc->Inputs().Tag(kImageSizeTag).Set>(); cc->Outputs().Tag(kRenderScaleTag).Set(); - + cc->SetProcessTimestampBounds( + cc->Options() + .process_timestamp_bounds()); return absl::OkStatus(); } diff --git a/mediapipe/calculators/util/rect_to_render_scale_calculator.proto b/mediapipe/calculators/util/rect_to_render_scale_calculator.proto index dda6e2c9..377b1241 100644 --- a/mediapipe/calculators/util/rect_to_render_scale_calculator.proto +++ b/mediapipe/calculators/util/rect_to_render_scale_calculator.proto @@ -29,4 +29,8 @@ message RectToRenderScaleCalculatorOptions { // when actual object size on the image will be `B`, than all RenderData // primitives will be scaled with factor `B/A`. optional float multiplier = 1 [default = 0.01]; + + // When true, Process is called for every new timestamp bound, with or without + // new packets. + optional bool process_timestamp_bounds = 2 [default = false]; }