Skip to content

Instantly share code, notes, and snippets.

@zacharynevin
zacharynevin / create_tfrecord.py
Last active February 13, 2019 04:48
Creating a TFRecord file for image data
import os
import cv2
import tensorflow as tf
def _bytes_feature(value):
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))