@@ -72,9 +72,9 @@ class YT8MAggregatedFeatureReader(BaseReader):
72
72
"""
73
73
74
74
def __init__ (self ,
75
- num_classes = 4716 ,
76
- feature_sizes = [1024 ],
77
- feature_names = ["mean_inc3 " ]):
75
+ num_classes = 3862 ,
76
+ feature_sizes = [1024 , 128 ],
77
+ feature_names = ["mean_rgb" , "mean_audio " ]):
78
78
"""Construct a YT8MAggregatedFeatureReader.
79
79
80
80
Args:
@@ -114,7 +114,7 @@ def prepare_serialized_examples(self, serialized_examples):
114
114
"length of feature_names (={}) != length of feature_sizes (={})" .format ( \
115
115
len (self .feature_names ), len (self .feature_sizes ))
116
116
117
- feature_map = {"video_id " : tf .FixedLenFeature ([], tf .string ),
117
+ feature_map = {"id " : tf .FixedLenFeature ([], tf .string ),
118
118
"labels" : tf .VarLenFeature (tf .int64 )}
119
119
for feature_index in range (num_features ):
120
120
feature_map [self .feature_names [feature_index ]] = tf .FixedLenFeature (
@@ -126,7 +126,7 @@ def prepare_serialized_examples(self, serialized_examples):
126
126
concatenated_features = tf .concat ([
127
127
features [feature_name ] for feature_name in self .feature_names ], 1 )
128
128
129
- return features ["video_id " ], concatenated_features , labels , tf .ones ([tf .shape (serialized_examples )[0 ]])
129
+ return features ["id " ], concatenated_features , labels , tf .ones ([tf .shape (serialized_examples )[0 ]])
130
130
131
131
class YT8MFrameFeatureReader (BaseReader ):
132
132
"""Reads TFRecords of SequenceExamples.
@@ -138,9 +138,9 @@ class YT8MFrameFeatureReader(BaseReader):
138
138
"""
139
139
140
140
def __init__ (self ,
141
- num_classes = 4716 ,
142
- feature_sizes = [1024 ],
143
- feature_names = ["inc3 " ],
141
+ num_classes = 3862 ,
142
+ feature_sizes = [1024 , 128 ],
143
+ feature_names = ["rgb" , "audio " ],
144
144
max_frames = 300 ):
145
145
"""Construct a YT8MFrameFeatureReader.
146
146
@@ -215,7 +215,7 @@ def prepare_serialized_examples(self, serialized_example,
215
215
216
216
contexts , features = tf .parse_single_sequence_example (
217
217
serialized_example ,
218
- context_features = {"video_id " : tf .FixedLenFeature (
218
+ context_features = {"id " : tf .FixedLenFeature (
219
219
[], tf .string ),
220
220
"labels" : tf .VarLenFeature (tf .int64 )},
221
221
sequence_features = {
@@ -261,7 +261,7 @@ def prepare_serialized_examples(self, serialized_example,
261
261
262
262
# convert to batch format.
263
263
# TODO: Do proper batch reads to remove the IO bottleneck.
264
- batch_video_ids = tf .expand_dims (contexts ["video_id " ], 0 )
264
+ batch_video_ids = tf .expand_dims (contexts ["id " ], 0 )
265
265
batch_video_matrix = tf .expand_dims (video_matrix , 0 )
266
266
batch_labels = tf .expand_dims (labels , 0 )
267
267
batch_frames = tf .expand_dims (num_frames , 0 )
0 commit comments