in 04_detect_segment/utils_box.py [0:0]
def x1y1x2y2_to_cxcyw(rois):
rois_x1, rois_y1, rois_x2, rois_y2 = tf.unstack(rois, axis=1) # rois shape [n, 4]
# center coordinates of the roi
rois_x = (rois_x1 + rois_x2) / 2.0
rois_y = (rois_y1 + rois_y2) / 2.0
rois_w = (rois_x2 - rois_x1)
rois = tf.stack([rois_x, rois_y, rois_w], axis=1) # rois shape [rois_n, 3]
return rois