Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between .record and .tfrecord

I've downloaded a dataset from https://public.roboflow.com/ which contains test.tfrecord and train.tfrecord

Is it the same than test.record and train.record?

like image 590
pedrobin Avatar asked Mar 17 '26 05:03

pedrobin


1 Answers

Yes, the file extension doesn't matter, they're in the TFRecord format. You can think of it a bit like a zip file though in that its structure can be freeform.

These specific ones are for use with the Tensorflow Object Detection API which expects the data inside the tfrecord to be laid out in a specific structure and order like this:

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),
    }))

There's a full tutorial on how to train with the Tensorflow 2.0 Object Detection API here.

like image 122
Brad Dwyer Avatar answered Mar 19 '26 02:03

Brad Dwyer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!