in 04_detect_segment/utils_box.py [0:0]
def standardize(rois):
# rois: shape [batch, 4] 4 numbers for x1, y1, x2, y2
# put the boxes in the standard orientation where x1 <= x2 and y1 <= y2
# boxintersect assumes boxes are in the standard format
x1, y1, x2, y2 = tf.unstack(rois, axis=-1)
stdx1 = tf.minimum(x1, x2)
stdy1 = tf.minimum(y1, y2)
stdx2 = tf.maximum(x1, x2)
stdy2 = tf.maximum(y1, y2)
return tf.stack([stdx1, stdy1, stdx2, stdy2], axis=-1)