Internal change
PiperOrigin-RevId: 521993439
This commit is contained in:
parent
91264eab1f
commit
425a3ee3f6
|
@ -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<int64>::max();
|
||||
int64_t closest_distance = std::numeric_limits<int64_t>::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<float>(timestamp_diff) / 1000000);
|
||||
return rate;
|
||||
|
@ -100,18 +100,18 @@ absl::Status ReconcileAnnotationIndicesByImageTimestamps(
|
|||
<< "start: " << segment_size
|
||||
<< ", end: " << GetSegmentEndTimestampSize(*sequence);
|
||||
|
||||
std::vector<int64> start_indices;
|
||||
std::vector<int64_t> 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<int64> end_indices;
|
||||
std::vector<int64_t> 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<int64> box_timestamps(num_bboxes);
|
||||
::std::vector<int64_t> 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<int32> box_is_annotated(num_bboxes);
|
||||
::std::vector<int32_t> 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<int64> image_timestamps(num_frames);
|
||||
::std::vector<int64_t> image_timestamps(num_frames);
|
||||
int frame_index = 0;
|
||||
for (auto& feature :
|
||||
GetFeatureList(*sequence, kImageTimestampKey).feature()) {
|
||||
|
|
|
@ -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<int64> label = {5, 3};
|
||||
std::vector<int64_t> 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<int64>({123, 456}), &sequence);
|
||||
SetSegmentStartTimestamp(::std::vector<int64_t>({123, 456}), &sequence);
|
||||
ASSERT_EQ(2, GetSegmentStartTimestampSize(sequence));
|
||||
ASSERT_THAT(GetSegmentStartTimestamp(sequence),
|
||||
testing::ElementsAreArray(::std::vector<int64>({123, 456})));
|
||||
testing::ElementsAreArray(::std::vector<int64_t>({123, 456})));
|
||||
}
|
||||
|
||||
TEST(MediaSequenceTest, RoundTripSegmentEndTimestamp) {
|
||||
tensorflow::SequenceExample sequence;
|
||||
EXPECT_FALSE(HasContext(sequence, kSegmentEndTimestampKey));
|
||||
SetSegmentEndTimestamp(::std::vector<int64>({123, 456}), &sequence);
|
||||
SetSegmentEndTimestamp(::std::vector<int64_t>({123, 456}), &sequence);
|
||||
ASSERT_EQ(2, GetSegmentEndTimestampSize(sequence));
|
||||
ASSERT_THAT(GetSegmentEndTimestamp(sequence),
|
||||
testing::ElementsAreArray(::std::vector<int64>({123, 456})));
|
||||
testing::ElementsAreArray(::std::vector<int64_t>({123, 456})));
|
||||
}
|
||||
|
||||
TEST(MediaSequenceTest, RoundTripSegmentStartIndex) {
|
||||
tensorflow::SequenceExample sequence;
|
||||
EXPECT_FALSE(HasContext(sequence, kSegmentStartIndexKey));
|
||||
SetSegmentStartIndex(::std::vector<int64>({123, 456}), &sequence);
|
||||
SetSegmentStartIndex(::std::vector<int64_t>({123, 456}), &sequence);
|
||||
ASSERT_EQ(2, GetSegmentStartIndexSize(sequence));
|
||||
ASSERT_THAT(GetSegmentStartIndex(sequence),
|
||||
testing::ElementsAreArray(::std::vector<int64>({123, 456})));
|
||||
testing::ElementsAreArray(::std::vector<int64_t>({123, 456})));
|
||||
}
|
||||
|
||||
TEST(MediaSequenceTest, RoundTripSegmentEndIndex) {
|
||||
tensorflow::SequenceExample sequence;
|
||||
EXPECT_FALSE(HasContext(sequence, kSegmentEndIndexKey));
|
||||
SetSegmentEndIndex(::std::vector<int64>({123, 456}), &sequence);
|
||||
SetSegmentEndIndex(::std::vector<int64_t>({123, 456}), &sequence);
|
||||
ASSERT_EQ(2, GetSegmentEndIndexSize(sequence));
|
||||
ASSERT_THAT(GetSegmentEndIndex(sequence),
|
||||
testing::ElementsAreArray(::std::vector<int64>({123, 456})));
|
||||
testing::ElementsAreArray(::std::vector<int64_t>({123, 456})));
|
||||
}
|
||||
|
||||
TEST(MediaSequenceTest, RoundTripSegmentLabelIndex) {
|
||||
tensorflow::SequenceExample sequence;
|
||||
EXPECT_FALSE(HasContext(sequence, kSegmentLabelIndexKey));
|
||||
SetSegmentLabelIndex(::std::vector<int64>({5, 7}), &sequence);
|
||||
SetSegmentLabelIndex(::std::vector<int64_t>({5, 7}), &sequence);
|
||||
ASSERT_EQ(2, GetSegmentLabelIndexSize(sequence));
|
||||
ASSERT_THAT(GetSegmentLabelIndex(sequence),
|
||||
testing::ElementsAreArray(::std::vector<int64>({5, 7})));
|
||||
testing::ElementsAreArray(::std::vector<int64_t>({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<int64> classes = {5, 3};
|
||||
std::vector<int64_t> 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<int64> classes = {5, 3};
|
||||
std::vector<int64_t> 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<std::vector<int64>> labels = {{5, 3}, {1, 2}};
|
||||
std::vector<std::vector<int64_t>> 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<std::vector<int64>> classes = {{5, 3}, {1, 2}};
|
||||
std::vector<std::vector<int64_t>> 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<std::vector<int64>> tracks = {{5, 3}, {1, 2}};
|
||||
std::vector<std::vector<int64_t>> 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<int64> timestamps = {3, 6};
|
||||
std::vector<int64_t> 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<int64> vi = {0, 1, 2, 4};
|
||||
std::vector<int64_t> 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<int64> timestamps = {4, 7};
|
||||
std::vector<int64_t> 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<int64> ids = {4, 7};
|
||||
std::vector<int64_t> 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<int64>({3, 4}), &sequence);
|
||||
SetSegmentEndTimestamp(::std::vector<int64>({4, 5}), &sequence);
|
||||
SetSegmentStartTimestamp(::std::vector<int64_t>({3, 4}), &sequence);
|
||||
SetSegmentEndTimestamp(::std::vector<int64_t>({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<int64>({1}), &sequence);
|
||||
AddBBoxLabelIndex(::std::vector<int64>({2}), &sequence);
|
||||
AddBBoxLabelIndex(::std::vector<int64_t>({1}), &sequence);
|
||||
AddBBoxLabelIndex(::std::vector<int64_t>({2}), &sequence);
|
||||
|
||||
AddBBoxLabelString(::std::vector<std::string>({"one"}), &sequence);
|
||||
AddBBoxLabelString(::std::vector<std::string>({"two"}), &sequence);
|
||||
|
||||
AddBBoxClassIndex(::std::vector<int64>({1}), &sequence);
|
||||
AddBBoxClassIndex(::std::vector<int64>({2}), &sequence);
|
||||
AddBBoxClassIndex(::std::vector<int64_t>({1}), &sequence);
|
||||
AddBBoxClassIndex(::std::vector<int64_t>({2}), &sequence);
|
||||
|
||||
AddBBoxClassString(::std::vector<std::string>({"one"}), &sequence);
|
||||
AddBBoxClassString(::std::vector<std::string>({"two"}), &sequence);
|
||||
|
||||
AddBBoxTrackIndex(::std::vector<int64>({1}), &sequence);
|
||||
AddBBoxTrackIndex(::std::vector<int64>({2}), &sequence);
|
||||
AddBBoxTrackIndex(::std::vector<int64_t>({1}), &sequence);
|
||||
AddBBoxTrackIndex(::std::vector<int64_t>({2}), &sequence);
|
||||
|
||||
AddBBoxTrackString(::std::vector<std::string>({"one"}), &sequence);
|
||||
AddBBoxTrackString(::std::vector<std::string>({"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<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 3),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxLabelIndexAt(sequence, 4),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
|
||||
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<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxClassIndexAt(sequence, 3),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxClassIndexAt(sequence, 4),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
|
||||
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<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 3),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
ASSERT_THAT(GetBBoxTrackIndexAt(sequence, 4),
|
||||
::testing::ElementsAreArray(::std::vector<int64>()));
|
||||
::testing::ElementsAreArray(::std::vector<int64_t>()));
|
||||
|
||||
ASSERT_THAT(GetBBoxTrackStringAt(sequence, 0),
|
||||
::testing::ElementsAreArray({"one"}));
|
||||
|
|
|
@ -253,7 +253,7 @@ TEST_F(MediaSequenceUtilTest, RoundTripFloatList) {
|
|||
TEST_F(MediaSequenceUtilTest, RoundTripInt64List) {
|
||||
tensorflow::SequenceExample sequence_example;
|
||||
std::string key = "key";
|
||||
std::vector<int64> expected_values{1, 3};
|
||||
std::vector<int64_t> 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<int64> clip_label_indices{2, 0};
|
||||
std::vector<int64_t> 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<int64> test_value = {47, 42};
|
||||
::std::vector<int64_t> 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<int64> test_value = {47, 42};
|
||||
::std::vector<int64_t> 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<int64>> test_value = {{47, 42}, {3, 5}};
|
||||
::std::vector<::std::vector<int64_t>> 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<int64> test_value_1 = {47, 42};
|
||||
::std::vector<int64> test_value_2 = {49, 47};
|
||||
::std::vector<int64_t> test_value_1 = {47, 42};
|
||||
::std::vector<int64_t> 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<int64> test_value = {47, 42};
|
||||
::std::vector<int64_t> 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<int64>> test_value_1 = {{47, 42}, {3, 5}};
|
||||
::std::vector<::std::vector<int64>> test_value_2 = {{49, 47}, {3, 5}};
|
||||
::std::vector<::std::vector<int64_t>> test_value_1 = {{47, 42}, {3, 5}};
|
||||
::std::vector<::std::vector<int64_t>> test_value_2 = {{49, 47}, {3, 5}};
|
||||
|
||||
ASSERT_FALSE(HasOneVectorInt64FeatureList(example));
|
||||
ASSERT_EQ(0, GetOneVectorInt64FeatureListSize(example));
|
||||
|
|
Loading…
Reference in New Issue
Block a user