def gather_surface_coords_for_parts(surface_coords_cropped, highest_scoring_part):
    'Gathers the (v, u) coordinates for the highest scoring DensePose parts.\n\n  Args:\n    surface_coords_cropped: A [max_detections, height, width, num_parts, 2]\n      float32 tensor with (v, u) surface coordinates.\n    highest_scoring_part: A [max_detections, height, width] integer tensor with\n      the highest scoring part (0-indexed) indices for each location.\n\n  Returns:\n    A [max_detections, height, width, 2] float32 tensor with the (v, u)\n    coordinates selected from the highest scoring parts.\n  '
    (max_detections, height, width, num_parts, _) = shape_utils.combined_static_and_dynamic_shape(surface_coords_cropped)
    flattened_surface_coords = tf.reshape(surface_coords_cropped, [(- 1), 2])
    flattened_part_ids = tf.reshape(highest_scoring_part, [(- 1)])
    flattened_lookup_indices = ((num_parts * tf.range(((max_detections * height) * width))) + flattened_part_ids)
    vu_coords_flattened = tf.gather(flattened_surface_coords, flattened_lookup_indices, axis=0)
    return tf.reshape(vu_coords_flattened, [max_detections, height, width, 2])
Gathers the (v, u) coordinates for the highest scoring DensePose parts.

Args:
  surface_coords_cropped: A [max_detections, height, width, num_parts, 2]
    float32 tensor with (v, u) surface coordinates.
  highest_scoring_part: A [max_detections, height, width] integer tensor with
    the highest scoring part (0-indexed) indices for each location.

Returns:
  A [max_detections, height, width, 2] float32 tensor with the (v, u)
  coordinates selected from the highest scoring parts.
def gather_surface_coords_for_parts(surface_coords_cropped, highest_scoring_part):
    'Gathers the (v, u) coordinates for the highest scoring DensePose parts.\n\n  Args:\n    surface_coords_cropped: A [max_detections, height, width, num_parts, 2]\n      float32 tensor with (v, u) surface coordinates.\n    highest_scoring_part: A [max_detections, height, width] integer tensor with\n      the highest scoring part (0-indexed) indices for each location.\n\n  Returns:\n    A [max_detections, height, width, 2] float32 tensor with the (v, u)\n    coordinates selected from the highest scoring parts.\n  '
    (max_detections, height, width, num_parts, _) = shape_utils.combined_static_and_dynamic_shape(surface_coords_cropped)
    flattened_surface_coords = tf.reshape(surface_coords_cropped, [(- 1), 2])
    flattened_part_ids = tf.reshape(highest_scoring_part, [(- 1)])
    flattened_lookup_indices = ((num_parts * tf.range(((max_detections * height) * width))) + flattened_part_ids)
    vu_coords_flattened = tf.gather(flattened_surface_coords, flattened_lookup_indices, axis=0)
    return tf.reshape(vu_coords_flattened, [max_detections, height, width, 2])