我有一个代码来获取图像的宽度和高度,以及边界框的类,xmin,xmax,ymin,ymax。但目前尚不清楚如何填充变量以生成tfrecords。根据以下代码,
height = None # Image height
width = None # Image width
filename = None # Filename of the image. Empty if image is not from file
encoded_image_data = None # Encoded image bytes
image_format = None # b'jpeg' or b'png'
xmins = [] # List of normalized left x coordinates in bounding box (1 per box)
xmaxs = [] # List of normalized right x coordinates in bounding box # (1 per box)
ymins = [] # List of normalized top y coordinates in bounding box (1 per box)
ymaxs = [] # List of normalized bottom y coordinates in bounding box # (1 per box)
classes_text = [] # List of string class name of bounding box (1 per box)
classes = [] # List of integer class id of bounding box (1 per box)
对于每个图像的多个边界框,应如何填充xmin,xmax,ymin,ymax和类?它们应该是行向量还是列向量?另外,对于类文本,它是否会根据边界框的顺序列出所有类名?还有,编码图像数据的预期是什么?
答案 0 :(得分:0)
以下是为Tensorflow Object Detection API设置自定义数据集的指南: https://github.com/tensorflow/models/blob/master/object_detection/g3doc/using_your_own_dataset.md
在你的情况下,xmin,xmax等应该只是一个普通的python列表。图像编码应该是jpeg或png(我相信两者都可以互换使用,但如果可能的话,我建议坚持使用一种格式保持一致)。