osc.data.tfrecords.serialize_image
- serialize_image(image)[source]
Serialize an image to be written to a TFRecord.
- Parameters
image (
Tensor
) – uint8 tensor of shape[H W 3]
Example
When calling this function from a :mod:
tf.data
pipeline, wrap it in a :func:tf.py_function
:>>> tf.py_function(serialize_image, (image,), tf.string)
- Return type
- Returns
A byte string.