def convert_to_example(pose, shape=None):
    """Build an Example proto for an image example.
    Args:
      pose: 72-D vector, float
     shape: 10-D vector, float
    Returns:
      Example proto
    """
    if shape is None:
        example = tf.train.Example(features=tf.train.Features(
            feature={'pose': float_feature(pose.astype(np.float))}))
    else:
        example = tf.train.Example(features=tf.train.Features(
            feature={
                'pose': float_feature(pose.astype(np.float)),
                'shape': float_feature(shape.astype(np.float)),
            }))

    return example
def convert_to_example_temporal(poses):
    """
    Builds example proto for a changes in pose.

    Args:
        pose (50x24x3): Axis-angle representation of the current pose.

    Returns:
        Example proto.
    """
    return tf.train.Example(features=tf.train.Features(
        feature={
            'pose': float_feature(poses.ravel()),
        }))