(data_bytes,
                  class_label,
                  writer,
                  input_key='image',
                  label_key='label')
Create and write an Example protocol buffer for the given image.

  Create a protocol buffer with an integer feature for the class label, and a
  bytes feature for the image.

  Args:
    data_bytes: bytes, an encoded image representation or serialized feature.
      For images, the usual encoding is JPEG, but could be different
      as long as the DataProvider's record_decoder accepts it.
    class_label: the integer class label of the image.
    writer: a TFRecordWriter
    input_key: String used as key for the input (image of feature).
    label_key: String used as key for the label.
Create and write an Example protocol buffer for the given image.
Create and write an Example protocol buffer for the given image .
def write_example(data_bytes,
                  class_label,
                  writer,
                  input_key='image',
                  label_key='label'):
  """Create and write an Example protocol buffer for the given image.

  Create a protocol buffer with an integer feature for the class label, and a
  bytes feature for the image.

  Args:
    data_bytes: bytes, an encoded image representation or serialized feature.
      For images, the usual encoding is JPEG, but could be different
      as long as the DataProvider's record_decoder accepts it.
    class_label: the integer class label of the image.
    writer: a TFRecordWriter
    input_key: String used as key for the input (image of feature).
    label_key: String used as key for the label.
  """
  example = make_example([(input_key, 'bytes', [data_bytes]),
                          (label_key, 'int64', [class_label])])
  writer.write(example)
def write_example ( data_bytes , class_label , writer , input_key = 'image' , label_key = 'label' ) : example = make_example ( [ ( input_key , 'bytes' , [ data_bytes ] ) , ( label_key , 'int64' , [ class_label ] ) ] ) writer . write ( example )