我已经从https://public.roboflow.com/下载了一个包含test.tfrecord和train.tfrecord的数据集
它和test.record和train.record一样吗?
发布于 2020-12-10 22:30:48
是的,文件扩展名无关紧要,它们在TFRecord format中。您可以认为它有点像zip文件,尽管它的结构可以是自由形式的。
这些特定的对象与Tensorflow对象检测API一起使用,它期望tfrecord中的数据以特定的结构和顺序进行布局,如下所示:
tf_example = tf.train.Example(features=tf.train.Features(feature={
'image/height': dataset_util.int64_feature(height),
'image/width': dataset_util.int64_feature(width),
'image/filename': dataset_util.bytes_feature(filename),
'image/source_id': dataset_util.bytes_feature(filename),
'image/encoded': dataset_util.bytes_feature(encoded_jpg),
'image/format': dataset_util.bytes_feature(image_format),
'image/object/bbox/xmin': dataset_util.float_list_feature(xmins),
'image/object/bbox/xmax': dataset_util.float_list_feature(xmaxs),
'image/object/bbox/ymin': dataset_util.float_list_feature(ymins),
'image/object/bbox/ymax': dataset_util.float_list_feature(ymaxs),
'image/object/class/text': dataset_util.bytes_list_feature(classes_text),
'image/object/class/label': dataset_util.int64_list_feature(classes),
}))在how to train with the Tensorflow 2.0 Object Detection API here上有完整的教程。
https://stackoverflow.com/questions/65225059
复制相似问题