def xywh_to_xyxy(boxes):
 return np.hstack((boxes[:, 0:2], ((boxes[:, 0:2] + boxes[:, 2:4]) - 1)))

def xywh_to_xyxy ( boxes ) : return np . hstack ( ( boxes [ : , 0 : 2 ] , ( ( boxes [ : , 0 : 2 ] + boxes [ : , 2 : 4 ] ) - 1 ) ) )
convert [x y w h] box format to [x1 y1 x2 y2] format .