def center_to_corner_coordinate(input_tensor):
  """Converts input boxes from center to corner representation."""
  reshaped_encodings = tf.reshape(input_tensor, [-1, 4])
  ycenter = tf.gather(reshaped_encodings, [0], axis=1)
  xcenter = tf.gather(reshaped_encodings, [1], axis=1)
  h = tf.gather(reshaped_encodings, [2], axis=1)
  w = tf.gather(reshaped_encodings, [3], axis=1)
  ymin = ycenter - h / 2.
  xmin = xcenter - w / 2.
  ymax = ycenter + h / 2.
  xmax = xcenter + w / 2.
  return tf.squeeze(tf.stack([ymin, xmin, ymax, xmax], axis=1))
Converts input boxes from center to corner representation.
inference_api/src/main/object_detection/utils/ops.py