Fix bounds calculation in RefineLandmarksFromHeatMapCalculator

Fixes https://github.com/google/mediapipe/issues/4414

PiperOrigin-RevId: 545794151
This commit is contained in:
Sebastian Schmidt 2023-07-05 14:56:13 -07:00 committed by Copybara-Service
parent 74f484d96d
commit 9861b3c8a8

View File

@ -124,7 +124,7 @@ absl::StatusOr<mediapipe::NormalizedLandmarkList> RefineLandmarksFromHeatMap(
int center_row = out_lms.landmark(lm_index).y() * hm_height; int center_row = out_lms.landmark(lm_index).y() * hm_height;
// Point is outside of the image let's keep it intact. // Point is outside of the image let's keep it intact.
if (center_col < 0 || center_col >= hm_width || center_row < 0 || if (center_col < 0 || center_col >= hm_width || center_row < 0 ||
center_col >= hm_height) { center_row >= hm_height) {
continue; continue;
} }