diff --git a/mediapipe/util/tensor_to_detection.cc b/mediapipe/util/tensor_to_detection.cc index 0b3d1f68a..1c19b3510 100644 --- a/mediapipe/util/tensor_to_detection.cc +++ b/mediapipe/util/tensor_to_detection.cc @@ -87,7 +87,7 @@ Status TensorsToDetections(const ::tensorflow::Tensor& num_detections, const auto& num_boxes_scalar = num_detections.scalar(); num_boxes = static_cast(num_boxes_scalar()); } else { - num_boxes = num_detections.scalar()(); + num_boxes = num_detections.scalar()(); } if (boxes.dim_size(0) < num_boxes) { return InvalidArgumentError( diff --git a/mediapipe/util/time_series_util.cc b/mediapipe/util/time_series_util.cc index 1e20daa59..87f69475a 100644 --- a/mediapipe/util/time_series_util.cc +++ b/mediapipe/util/time_series_util.cc @@ -29,7 +29,7 @@ namespace time_series_util { bool LogWarningIfTimestampIsInconsistent(const Timestamp& current_timestamp, const Timestamp& initial_timestamp, - int64 cumulative_samples, + int64_t cumulative_samples, double sample_rate) { // Ignore the "special" timestamp value Done(). if (current_timestamp == Timestamp::Done()) return true; @@ -122,11 +122,11 @@ absl::Status IsMatrixShapeConsistentWithHeader(const Matrix& matrix, return absl::OkStatus(); } -int64 SecondsToSamples(double time_in_seconds, double sample_rate) { +int64_t SecondsToSamples(double time_in_seconds, double sample_rate) { return round(time_in_seconds * sample_rate); } -double SamplesToSeconds(int64 num_samples, double sample_rate) { +double SamplesToSeconds(int64_t num_samples, double sample_rate) { DCHECK_NE(sample_rate, 0.0); return (num_samples / sample_rate); } diff --git a/mediapipe/util/time_series_util_test.cc b/mediapipe/util/time_series_util_test.cc index 807bc4f03..e8d47dbc6 100644 --- a/mediapipe/util/time_series_util_test.cc +++ b/mediapipe/util/time_series_util_test.cc @@ -186,7 +186,7 @@ TEST(TimeSeriesUtilTest, SecondsToSamples) { TEST(TimeSeriesUtilTest, SamplesToSeconds) { double sample_rate = 32.5; - int64 num_samples = 128; + int64_t num_samples = 128; EXPECT_EQ(num_samples / sample_rate, SamplesToSeconds(num_samples, sample_rate)); }