From 9861b3c8a8232e948d102385f6f8670080ea5391 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 5 Jul 2023 14:56:13 -0700 Subject: [PATCH] Fix bounds calculation in RefineLandmarksFromHeatMapCalculator Fixes https://github.com/google/mediapipe/issues/4414 PiperOrigin-RevId: 545794151 --- .../util/refine_landmarks_from_heatmap_calculator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.cc b/mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.cc index 59b21d574..30dc11dbe 100644 --- a/mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.cc +++ b/mediapipe/calculators/util/refine_landmarks_from_heatmap_calculator.cc @@ -124,7 +124,7 @@ absl::StatusOr RefineLandmarksFromHeatMap( int center_row = out_lms.landmark(lm_index).y() * hm_height; // Point is outside of the image let's keep it intact. if (center_col < 0 || center_col >= hm_width || center_row < 0 || - center_col >= hm_height) { + center_row >= hm_height) { continue; }