(bbox, addaxis=None)
transform the left-top right-bottom encoding bounding boxes
        to center and size encodings
transform the left-top right-bottom encoding bounding boxes
        to center and size encodings
transform the left - top right - bottom encoding bounding boxes to center and size encodings
def _box_ltrb_to_cs_opr(bbox, addaxis=None):
        """ transform the left-top right-bottom encoding bounding boxes
        to center and size encodings"""
        bbox_width = bbox[:, 2] - bbox[:, 0]
        bbox_height = bbox[:, 3] - bbox[:, 1]
        bbox_ctr_x = bbox[:, 0] + 0.5 * bbox_width
        bbox_ctr_y = bbox[:, 1] + 0.5 * bbox_height
        if addaxis is None:
            return bbox_width, bbox_height, bbox_ctr_x, bbox_ctr_y
        else:
            return (
                F.expand_dims(bbox_width, addaxis),
                F.expand_dims(bbox_height, addaxis),
                F.expand_dims(bbox_ctr_x, addaxis),
                F.expand_dims(bbox_ctr_y, addaxis),
            )
def _box_ltrb_to_cs_opr ( bbox , addaxis = None ) : bbox_width = bbox [ : , 2 ] - bbox [ : , 0 ] bbox_height = bbox [ : , 3 ] - bbox [ : , 1 ] bbox_ctr_x = bbox [ : , 0 ] + 0.5 * bbox_width bbox_ctr_y = bbox [ : , 1 ] + 0.5 * bbox_height if addaxis is None : return bbox_width , bbox_height , bbox_ctr_x , bbox_ctr_y else : return ( F . expand_dims ( bbox_width , addaxis ) , F . expand_dims ( bbox_height , addaxis ) , F . expand_dims ( bbox_ctr_x , addaxis ) , F . expand_dims ( bbox_ctr_y , addaxis ) , )