def __read(self, filename_queue):
class CocoRecord(object):
image_raw = []
bboxes = []
categories = []
image_id = -1
pass
result = CocoRecord()
reader = tf.TFRecordReader()
_, value = reader.read(filename_queue)
features = tf.parse_single_example(
value,
features={
'labels': tf.FixedLenFeature([1], tf.string),
'image_raw': tf.FixedLenFeature([1], tf.string),
'image_width': tf.FixedLenFeature([1], tf.int64),
'image_height': tf.FixedLenFeature([1], tf.int64)
})
result.labels = tf.decode_raw(features['labels'], tf.int16)
result.image_raw = tf.decode_raw(features['image_raw'], tf.uint8)
result.width = features['image_width']
result.height = features['image_height']
return result
评论列表
文章目录