def _convert_to_example(filename, video_buffer, label, text, height, width, sequence_length):
"""Deprecated: use _convert_to_sequential_example instead
Build an Example proto for an example.
Args:
filename: string, path to a video file, e.g., '/path/to/example.avi'
video_buffer: numpy array with the video frames, with dims [n_frames, height, width, n_channels]
label: integer or list of integers, identifier for the ground truth for the network
text: string, unique human-readable, e.g. 'dog'
height: integer, image height in pixels
width: integer, image width in pixels
sequence_length: real length of the data, i.e. number of frames that are not zero-padding
Returns:
Example proto
"""
example = tf.train.Example(features=tf.train.Features(feature={
'sequence_length': _int64_feature(sequence_length),
'height': _int64_feature(height),
'width': _int64_feature(width),
'class/label': _int64_feature(label),
'class/text': _bytes_feature(text),
'filename': _bytes_feature(os.path.basename(filename)),
'frames': _bytes_feature(video_buffer.tostring())}))
return example
generate_tfrecord.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录