用于自定义数据的张量流对象检测标签

tensorflow object detection labels for custom data

我有一个代码来获取图像的宽度和高度,以及边界框的 class、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 和 classes?它们应该是行向量还是列向量?此外,对于 classes 文本,它是否会根据边界框的顺序列出所有 class 名称?另外,编码图像数据中的预期内容是什么?

这是为 Tensorflow 对象检测设置自定义数据集的指南 API: https://github.com/tensorflow/models/blob/master/object_detection/g3doc/using_your_own_dataset.md

在您的例子中,xmin、xmax 等应该只是一个普通的 python 列表。图像编码应该是jpeg或png(我相信两者可以互换使用,但我建议尽可能坚持使用一种格式以保持一致性)。