From 425a3ee3f69e2641407263524f99c5ce5ac51862 Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Wed, 5 Apr 2023 02:23:50 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 521993439 --- mediapipe/util/sequence/media_sequence.cc | 30 +++--- .../util/sequence/media_sequence_test.cc | 92 +++++++++---------- .../util/sequence/media_sequence_util_test.cc | 34 +++---- 3 files changed, 78 insertions(+), 78 deletions(-) diff --git a/mediapipe/util/sequence/media_sequence.cc b/mediapipe/util/sequence/media_sequence.cc index f76c53295..287db6181 100644 --- a/mediapipe/util/sequence/media_sequence.cc +++ b/mediapipe/util/sequence/media_sequence.cc @@ -57,13 +57,13 @@ bool ImageMetadata(const std::string& image_str, std::string* format_string, // Finds the nearest timestamp in a FeatureList of timestamps. The FeatureList // must contain int64 values and only the first value at each step is used. -int NearestIndex(int64 timestamp, +int NearestIndex(int64_t timestamp, const tensorflow::FeatureList& int64_feature_list) { - int64 closest_distance = std::numeric_limits::max(); + int64_t closest_distance = std::numeric_limits::max(); int index = -1; for (int i = 0; i < int64_feature_list.feature_size(); ++i) { - int64 current_value = int64_feature_list.feature(i).int64_list().value(0); - int64 current_distance = std::abs(current_value - timestamp); + int64_t current_value = int64_feature_list.feature(i).int64_list().value(0); + int64_t current_distance = std::abs(current_value - timestamp); if (current_distance < closest_distance) { index = i; closest_distance = current_distance; @@ -74,8 +74,8 @@ int NearestIndex(int64 timestamp, // Find the numerical sampling rate between two values in seconds if the input // timestamps are in microseconds. -float TimestampsToRate(int64 first_timestamp, int64 second_timestamp) { - int64 timestamp_diff = second_timestamp - first_timestamp; +float TimestampsToRate(int64_t first_timestamp, int64_t second_timestamp) { + int64_t timestamp_diff = second_timestamp - first_timestamp; // convert from microseconds to seconds. float rate = 1.0 / (static_cast(timestamp_diff) / 1000000); return rate; @@ -100,18 +100,18 @@ absl::Status ReconcileAnnotationIndicesByImageTimestamps( << "start: " << segment_size << ", end: " << GetSegmentEndTimestampSize(*sequence); - std::vector start_indices; + std::vector start_indices; start_indices.reserve(segment_size); - for (const int64& timestamp : GetSegmentStartTimestamp(*sequence)) { + for (const int64_t& timestamp : GetSegmentStartTimestamp(*sequence)) { index = NearestIndex(timestamp, GetFeatureList(*sequence, kImageTimestampKey)); start_indices.push_back(index); } SetSegmentStartIndex(start_indices, sequence); - std::vector end_indices; + std::vector end_indices; end_indices.reserve(segment_size); - for (const int64& timestamp : GetSegmentEndTimestamp(*sequence)) { + for (const int64_t& timestamp : GetSegmentEndTimestamp(*sequence)) { index = NearestIndex(timestamp, GetFeatureList(*sequence, kImageTimestampKey)); end_indices.push_back(index); @@ -167,8 +167,8 @@ absl::Status ReconcileMetadataFeatureFloats( int number_of_elements = GetFeatureFloatsAt(prefix, *sequence, 0).size(); if (HasFeatureDimensions(prefix, *sequence) && !GetFeatureDimensions(prefix, *sequence).empty()) { - int64 product = 1; - for (int64 value : GetFeatureDimensions(prefix, *sequence)) { + int64_t product = 1; + for (int64_t value : GetFeatureDimensions(prefix, *sequence)) { product *= value; } RET_CHECK_EQ(number_of_elements, product) @@ -249,14 +249,14 @@ absl::Status ReconcileMetadataBoxAnnotations( // Collect which timestamps currently match to which indices in timestamps. // skip empty timestamps. // Requires sorted indices. - ::std::vector box_timestamps(num_bboxes); + ::std::vector box_timestamps(num_bboxes); int bbox_index = 0; std::string timestamp_key = merge_prefix(prefix, kRegionTimestampKey); for (auto& feature : GetFeatureList(*sequence, timestamp_key).feature()) { box_timestamps[bbox_index] = feature.int64_list().value(0); ++bbox_index; } - ::std::vector box_is_annotated(num_bboxes); + ::std::vector box_is_annotated(num_bboxes); bbox_index = 0; std::string is_annotated_key = merge_prefix(prefix, kRegionIsAnnotatedKey); for (auto& feature : @@ -264,7 +264,7 @@ absl::Status ReconcileMetadataBoxAnnotations( box_is_annotated[bbox_index] = feature.int64_list().value(0); ++bbox_index; } - ::std::vector image_timestamps(num_frames); + ::std::vector image_timestamps(num_frames); int frame_index = 0; for (auto& feature : GetFeatureList(*sequence, kImageTimestampKey).feature()) { diff --git a/mediapipe/util/sequence/media_sequence_test.cc b/mediapipe/util/sequence/media_sequence_test.cc index 0797ed472..e220eace0 100644 --- a/mediapipe/util/sequence/media_sequence_test.cc +++ b/mediapipe/util/sequence/media_sequence_test.cc @@ -67,7 +67,7 @@ TEST(MediaSequenceTest, RoundTripEncodedMediaBytes) { TEST(MediaSequenceTest, RoundTripEncodedVideoStartTimestamp) { tensorflow::SequenceExample sequence; - int64 data = 47; + int64_t data = 47; SetClipEncodedMediaStartTimestamp(data, &sequence); ASSERT_EQ(GetClipEncodedMediaStartTimestamp(sequence), data); } @@ -92,7 +92,7 @@ TEST(MediaSequenceTest, RoundTripClipEndTimestamp) { TEST(MediaSequenceTest, RoundTripClipLabelIndex) { tensorflow::SequenceExample sequence; - std::vector label = {5, 3}; + std::vector label = {5, 3}; SetClipLabelIndex(label, &sequence); ASSERT_THAT(GetClipLabelIndex(sequence), testing::ElementsAreArray(label)); } @@ -115,46 +115,46 @@ TEST(MediaSequenceTest, RoundTripFloatListFrameRate) { TEST(MediaSequenceTest, RoundTripSegmentStartTimestamp) { tensorflow::SequenceExample sequence; EXPECT_FALSE(HasContext(sequence, kSegmentStartTimestampKey)); - SetSegmentStartTimestamp(::std::vector({123, 456}), &sequence); + SetSegmentStartTimestamp(::std::vector({123, 456}), &sequence); ASSERT_EQ(2, GetSegmentStartTimestampSize(sequence)); ASSERT_THAT(GetSegmentStartTimestamp(sequence), - testing::ElementsAreArray(::std::vector({123, 456}))); + testing::ElementsAreArray(::std::vector({123, 456}))); } TEST(MediaSequenceTest, RoundTripSegmentEndTimestamp) { tensorflow::SequenceExample sequence; EXPECT_FALSE(HasContext(sequence, kSegmentEndTimestampKey)); - SetSegmentEndTimestamp(::std::vector({123, 456}), &sequence); + SetSegmentEndTimestamp(::std::vector({123, 456}), &sequence); ASSERT_EQ(2, GetSegmentEndTimestampSize(sequence)); ASSERT_THAT(GetSegmentEndTimestamp(sequence), - testing::ElementsAreArray(::std::vector({123, 456}))); + testing::ElementsAreArray(::std::vector({123, 456}))); } TEST(MediaSequenceTest, RoundTripSegmentStartIndex) { tensorflow::SequenceExample sequence; EXPECT_FALSE(HasContext(sequence, kSegmentStartIndexKey)); - SetSegmentStartIndex(::std::vector({123, 456}), &sequence); + SetSegmentStartIndex(::std::vector({123, 456}), &sequence); ASSERT_EQ(2, GetSegmentStartIndexSize(sequence)); ASSERT_THAT(GetSegmentStartIndex(sequence), - testing::ElementsAreArray(::std::vector({123, 456}))); + testing::ElementsAreArray(::std::vector({123, 456}))); } TEST(MediaSequenceTest, RoundTripSegmentEndIndex) { tensorflow::SequenceExample sequence; EXPECT_FALSE(HasContext(sequence, kSegmentEndIndexKey)); - SetSegmentEndIndex(::std::vector({123, 456}), &sequence); + SetSegmentEndIndex(::std::vector({123, 456}), &sequence); ASSERT_EQ(2, GetSegmentEndIndexSize(sequence)); ASSERT_THAT(GetSegmentEndIndex(sequence), - testing::ElementsAreArray(::std::vector({123, 456}))); + testing::ElementsAreArray(::std::vector({123, 456}))); } TEST(MediaSequenceTest, RoundTripSegmentLabelIndex) { tensorflow::SequenceExample sequence; EXPECT_FALSE(HasContext(sequence, kSegmentLabelIndexKey)); - SetSegmentLabelIndex(::std::vector({5, 7}), &sequence); + SetSegmentLabelIndex(::std::vector({5, 7}), &sequence); ASSERT_EQ(2, GetSegmentLabelIndexSize(sequence)); ASSERT_THAT(GetSegmentLabelIndex(sequence), - testing::ElementsAreArray(::std::vector({5, 7}))); + testing::ElementsAreArray(::std::vector({5, 7}))); } TEST(MediaSequenceTest, RoundTripSegmentLabelString) { @@ -180,8 +180,8 @@ TEST(MediaSequenceTest, RoundTripSegmentLabelConfidence) { TEST(MediaSequenceTest, RoundTripImageWidthHeight) { tensorflow::SequenceExample sequence; - int64 height = 2; - int64 width = 3; + int64_t height = 2; + int64_t width = 3; SetImageHeight(height, &sequence); ASSERT_EQ(GetImageHeight(sequence), height); SetImageWidth(width, &sequence); @@ -190,8 +190,8 @@ TEST(MediaSequenceTest, RoundTripImageWidthHeight) { TEST(MediaSequenceTest, RoundTripForwardFlowWidthHeight) { tensorflow::SequenceExample sequence; - int64 height = 2; - int64 width = 3; + int64_t height = 2; + int64_t width = 3; SetForwardFlowHeight(height, &sequence); ASSERT_EQ(GetForwardFlowHeight(sequence), height); SetForwardFlowWidth(width, &sequence); @@ -200,8 +200,8 @@ TEST(MediaSequenceTest, RoundTripForwardFlowWidthHeight) { TEST(MediaSequenceTest, RoundTripClassSegmentationWidthHeightFormat) { tensorflow::SequenceExample sequence; - int64 height = 2; - int64 width = 3; + int64_t height = 2; + int64_t width = 3; std::string format = "JPEG"; SetClassSegmentationHeight(height, &sequence); EXPECT_EQ(GetClassSegmentationHeight(sequence), height); @@ -213,7 +213,7 @@ TEST(MediaSequenceTest, RoundTripClassSegmentationWidthHeightFormat) { TEST(MediaSequenceTest, RoundTripClassSegmentationLabelIndex) { tensorflow::SequenceExample sequence; - std::vector classes = {5, 3}; + std::vector classes = {5, 3}; SetClassSegmentationClassLabelIndex(classes, &sequence); ASSERT_THAT(GetClassSegmentationClassLabelIndex(sequence), testing::ElementsAreArray({5, 3})); @@ -233,8 +233,8 @@ TEST(MediaSequenceTest, RoundTripClassSegmentationLabelString) { TEST(MediaSequenceTest, RoundTripInstanceSegmentationWidthHeightFormat) { tensorflow::SequenceExample sequence; - int64 height = 2; - int64 width = 3; + int64_t height = 2; + int64_t width = 3; std::string format = "JPEG"; SetInstanceSegmentationHeight(height, &sequence); EXPECT_EQ(GetInstanceSegmentationHeight(sequence), height); @@ -246,7 +246,7 @@ TEST(MediaSequenceTest, RoundTripInstanceSegmentationWidthHeightFormat) { TEST(MediaSequenceTest, RoundTripInstanceSegmentationClass) { tensorflow::SequenceExample sequence; - std::vector classes = {5, 3}; + std::vector classes = {5, 3}; SetInstanceSegmentationObjectClassIndex(classes, &sequence); ASSERT_THAT(GetInstanceSegmentationObjectClassIndex(sequence), testing::ElementsAreArray({5, 3})); @@ -286,7 +286,7 @@ TEST(MediaSequenceTest, RoundTripBBoxNumRegions) { TEST(MediaSequenceTest, RoundTripBBoxLabelIndex) { tensorflow::SequenceExample sequence; - std::vector> labels = {{5, 3}, {1, 2}}; + std::vector> labels = {{5, 3}, {1, 2}}; for (int i = 0; i < labels.size(); ++i) { AddBBoxLabelIndex(labels[i], &sequence); ASSERT_EQ(GetBBoxLabelIndexSize(sequence), i + 1); @@ -312,7 +312,7 @@ TEST(MediaSequenceTest, RoundTripBBoxLabelString) { TEST(MediaSequenceTest, RoundTripBBoxClassIndex) { tensorflow::SequenceExample sequence; - std::vector> classes = {{5, 3}, {1, 2}}; + std::vector> classes = {{5, 3}, {1, 2}}; for (int i = 0; i < classes.size(); ++i) { AddBBoxClassIndex(classes[i], &sequence); ASSERT_EQ(GetBBoxClassIndexSize(sequence), i + 1); @@ -338,7 +338,7 @@ TEST(MediaSequenceTest, RoundTripBBoxClassString) { TEST(MediaSequenceTest, RoundTripBBoxTrackIndex) { tensorflow::SequenceExample sequence; - std::vector> tracks = {{5, 3}, {1, 2}}; + std::vector> tracks = {{5, 3}, {1, 2}}; for (int i = 0; i < tracks.size(); ++i) { AddBBoxTrackIndex(tracks[i], &sequence); ASSERT_EQ(GetBBoxTrackIndexSize(sequence), i + 1); @@ -499,7 +499,7 @@ TEST(MediaSequenceTest, RoundTripPredictedBBox) { TEST(MediaSequenceTest, RoundTripPredictedBBoxTimestamp) { tensorflow::SequenceExample sequence; - std::vector timestamps = {3, 6}; + std::vector timestamps = {3, 6}; for (int i = 0; i < timestamps.size(); ++i) { AddPredictedBBoxTimestamp(timestamps[i], &sequence); ASSERT_EQ(GetPredictedBBoxTimestampSize(sequence), i + 1); @@ -659,7 +659,7 @@ TEST(MediaSequenceTest, RoundTripContextFeatureBytes) { TEST(MediaSequenceTest, RoundTripContextFeatureInts) { tensorflow::SequenceExample sequence; std::string feature_key = "TEST"; - std::vector vi = {0, 1, 2, 4}; + std::vector vi = {0, 1, 2, 4}; SetContextFeatureInts(feature_key, vi, &sequence); ASSERT_EQ(GetContextFeatureInts(feature_key, sequence).size(), vi.size()); ASSERT_EQ(GetContextFeatureInts(feature_key, sequence)[3], vi[3]); @@ -725,7 +725,7 @@ TEST(MediaSequenceTest, RoundTripTextContent) { TEST(MediaSequenceTest, RoundTripTextDuration) { tensorflow::SequenceExample sequence; - std::vector timestamps = {4, 7}; + std::vector timestamps = {4, 7}; for (int i = 0; i < timestamps.size(); ++i) { AddTextTimestamp(timestamps[i], &sequence); ASSERT_EQ(GetTextTimestampSize(sequence), i + 1); @@ -765,7 +765,7 @@ TEST(MediaSequenceTest, RoundTripTextEmbedding) { TEST(MediaSequenceTest, RoundTripTextTokenId) { tensorflow::SequenceExample sequence; - std::vector ids = {4, 7}; + std::vector ids = {4, 7}; for (int i = 0; i < ids.size(); ++i) { AddTextTokenId(ids[i], &sequence); ASSERT_EQ(GetTextTokenIdSize(sequence), i + 1); @@ -783,8 +783,8 @@ TEST(MediaSequenceTest, ReconcileMetadataOnEmptySequence) { TEST(MediaSequenceTest, ReconcileMetadataImagestoLabels) { // Need image timestamps and label timestamps. tensorflow::SequenceExample sequence; - SetSegmentStartTimestamp(::std::vector({3, 4}), &sequence); - SetSegmentEndTimestamp(::std::vector({4, 5}), &sequence); + SetSegmentStartTimestamp(::std::vector({3, 4}), &sequence); + SetSegmentEndTimestamp(::std::vector({4, 5}), &sequence); // Skip 0, so the indices are the timestamp - 1 AddImageTimestamp(1, &sequence); @@ -1027,20 +1027,20 @@ TEST(MediaSequenceTest, ReconcileMetadataBoxAnnotationsUpdatesAllFeatures) { AddBBoxNumRegions(1, &sequence); AddBBoxNumRegions(1, &sequence); - AddBBoxLabelIndex(::std::vector({1}), &sequence); - AddBBoxLabelIndex(::std::vector({2}), &sequence); + AddBBoxLabelIndex(::std::vector({1}), &sequence); + AddBBoxLabelIndex(::std::vector({2}), &sequence); AddBBoxLabelString(::std::vector({"one"}), &sequence); AddBBoxLabelString(::std::vector({"two"}), &sequence); - AddBBoxClassIndex(::std::vector({1}), &sequence); - AddBBoxClassIndex(::std::vector({2}), &sequence); + AddBBoxClassIndex(::std::vector({1}), &sequence); + AddBBoxClassIndex(::std::vector({2}), &sequence); AddBBoxClassString(::std::vector({"one"}), &sequence); AddBBoxClassString(::std::vector({"two"}), &sequence); - AddBBoxTrackIndex(::std::vector({1}), &sequence); - AddBBoxTrackIndex(::std::vector({2}), &sequence); + AddBBoxTrackIndex(::std::vector({1}), &sequence); + AddBBoxTrackIndex(::std::vector({2}), &sequence); AddBBoxTrackString(::std::vector({"one"}), &sequence); AddBBoxTrackString(::std::vector({"two"}), &sequence); @@ -1083,11 +1083,11 @@ TEST(MediaSequenceTest, ReconcileMetadataBoxAnnotationsUpdatesAllFeatures) { ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 1), ::testing::ElementsAreArray({2})); ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 2), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 3), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 4), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxLabelStringAt(sequence, 0), ::testing::ElementsAreArray({"one"})); @@ -1105,11 +1105,11 @@ TEST(MediaSequenceTest, ReconcileMetadataBoxAnnotationsUpdatesAllFeatures) { ASSERT_THAT(GetBBoxClassIndexAt(sequence, 1), ::testing::ElementsAreArray({2})); ASSERT_THAT(GetBBoxClassIndexAt(sequence, 2), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxClassIndexAt(sequence, 3), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxClassIndexAt(sequence, 4), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxClassStringAt(sequence, 0), ::testing::ElementsAreArray({"one"})); @@ -1127,11 +1127,11 @@ TEST(MediaSequenceTest, ReconcileMetadataBoxAnnotationsUpdatesAllFeatures) { ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 1), ::testing::ElementsAreArray({2})); ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 2), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 3), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 4), - ::testing::ElementsAreArray(::std::vector())); + ::testing::ElementsAreArray(::std::vector())); ASSERT_THAT(GetBBoxTrackStringAt(sequence, 0), ::testing::ElementsAreArray({"one"})); diff --git a/mediapipe/util/sequence/media_sequence_util_test.cc b/mediapipe/util/sequence/media_sequence_util_test.cc index 56d3b4868..8709165e3 100644 --- a/mediapipe/util/sequence/media_sequence_util_test.cc +++ b/mediapipe/util/sequence/media_sequence_util_test.cc @@ -253,7 +253,7 @@ TEST_F(MediaSequenceUtilTest, RoundTripFloatList) { TEST_F(MediaSequenceUtilTest, RoundTripInt64List) { tensorflow::SequenceExample sequence_example; std::string key = "key"; - std::vector expected_values{1, 3}; + std::vector expected_values{1, 3}; AddInt64Container(key, expected_values, &sequence_example); auto values = GetInt64sAt(sequence_example, key, 0); ASSERT_EQ(expected_values.size(), values.size()); @@ -302,7 +302,7 @@ TEST_F(MediaSequenceUtilTest, RoundTripContextFeatureList) { } // Test context in64 list. std::string clip_label_index_key = "clip_label_index"; - std::vector clip_label_indices{2, 0}; + std::vector clip_label_indices{2, 0}; SetContextInt64List(clip_label_index_key, clip_label_indices, &sequence_example); for (int i = 0; i < clip_label_indices.size(); ++i) { @@ -333,7 +333,7 @@ TEST_F(MediaSequenceUtilTest, ContextKeyMissing) { TEST_F(MediaSequenceUtilTest, RoundTripFeatureListsFeature) { tensorflow::SequenceExample sequence_example; std::string timestamp_key = "timestamp"; - int64 timestamp = 1000; + int64_t timestamp = 1000; MutableFeatureList(timestamp_key, &sequence_example) ->add_feature() ->mutable_int64_list() @@ -413,7 +413,7 @@ TEST_F(MediaSequenceUtilTest, StringFeature) { TEST_F(MediaSequenceUtilTest, Int64Feature) { tensorflow::SequenceExample example; - int64 test_value = 47; + int64_t test_value = 47; ASSERT_FALSE(HasInt64Feature(example)); SetInt64Feature(test_value, &example); @@ -426,7 +426,7 @@ TEST_F(MediaSequenceUtilTest, Int64Feature) { TEST_F(MediaSequenceUtilTest, FloatFeature) { tensorflow::SequenceExample example; - int64 test_value = 47.0f; + int64_t test_value = 47.0f; ASSERT_FALSE(HasFloatFeature(example)); SetFloatFeature(test_value, &example); @@ -464,7 +464,7 @@ TEST_F(MediaSequenceUtilTest, StringVectorFeature) { TEST_F(MediaSequenceUtilTest, Int64VectorFeature) { tensorflow::SequenceExample example; - ::std::vector test_value = {47, 42}; + ::std::vector test_value = {47, 42}; ASSERT_FALSE(HasInt64VectorFeature(example)); ASSERT_EQ(0, GetInt64VectorFeatureSize(example)); @@ -535,7 +535,7 @@ TEST_F(MediaSequenceUtilTest, StringFeatureList) { TEST_F(MediaSequenceUtilTest, Int64FeatureList) { tensorflow::SequenceExample example; - ::std::vector test_value = {47, 42}; + ::std::vector test_value = {47, 42}; ASSERT_FALSE(HasInt64FeatureList(example)); ASSERT_EQ(0, GetInt64FeatureListSize(example)); @@ -602,7 +602,7 @@ TEST_F(MediaSequenceUtilTest, VectorStringFeatureList) { TEST_F(MediaSequenceUtilTest, VectorInt64FeatureList) { tensorflow::SequenceExample example; - ::std::vector<::std::vector> test_value = {{47, 42}, {3, 5}}; + ::std::vector<::std::vector> test_value = {{47, 42}, {3, 5}}; ASSERT_FALSE(HasVectorInt64FeatureList(example)); ASSERT_EQ(0, GetVectorInt64FeatureListSize(example)); @@ -704,8 +704,8 @@ TEST_F(MediaSequenceUtilTest, VariablePrefixStringFeature) { TEST_F(MediaSequenceUtilTest, FixedPrefixInt64Feature) { tensorflow::SequenceExample example; - int64 test_value_1 = 47; - int64 test_value_2 = 49; + int64_t test_value_1 = 47; + int64_t test_value_2 = 49; ASSERT_FALSE(HasOneInt64Feature(example)); SetOneInt64Feature(test_value_1, &example); @@ -727,8 +727,8 @@ TEST_F(MediaSequenceUtilTest, FixedPrefixInt64Feature) { TEST_F(MediaSequenceUtilTest, FixedPrefixFloatFeature) { tensorflow::SequenceExample example; - int64 test_value_1 = 47.0f; - int64 test_value_2 = 49.0f; + int64_t test_value_1 = 47.0f; + int64_t test_value_2 = 49.0f; ASSERT_FALSE(HasOneFloatFeature(example)); SetOneFloatFeature(test_value_1, &example); @@ -795,8 +795,8 @@ TEST_F(MediaSequenceUtilTest, FixedPrefixStringVectorFeature) { TEST_F(MediaSequenceUtilTest, FixedPrefixInt64VectorFeature) { tensorflow::SequenceExample example; - ::std::vector test_value_1 = {47, 42}; - ::std::vector test_value_2 = {49, 47}; + ::std::vector test_value_1 = {47, 42}; + ::std::vector test_value_2 = {49, 47}; ASSERT_FALSE(HasOneInt64VectorFeature(example)); ASSERT_EQ(0, GetOneInt64VectorFeatureSize(example)); @@ -905,7 +905,7 @@ TEST_F(MediaSequenceUtilTest, FixedPrefixStringFeatureList) { TEST_F(MediaSequenceUtilTest, FixedPrefixInt64FeatureList) { tensorflow::SequenceExample example; - ::std::vector test_value = {47, 42}; + ::std::vector test_value = {47, 42}; ASSERT_FALSE(HasInt64FeatureList(example)); ASSERT_EQ(0, GetInt64FeatureListSize(example)); @@ -990,8 +990,8 @@ TEST_F(MediaSequenceUtilTest, FixedPrefixVectorStringFeatureList) { TEST_F(MediaSequenceUtilTest, FixedPrefixVectorInt64FeatureList) { tensorflow::SequenceExample example; - ::std::vector<::std::vector> test_value_1 = {{47, 42}, {3, 5}}; - ::std::vector<::std::vector> test_value_2 = {{49, 47}, {3, 5}}; + ::std::vector<::std::vector> test_value_1 = {{47, 42}, {3, 5}}; + ::std::vector<::std::vector> test_value_2 = {{49, 47}, {3, 5}}; ASSERT_FALSE(HasOneVectorInt64FeatureList(example)); ASSERT_EQ(0, GetOneVectorInt64FeatureListSize(example));