code: def point8_to_box(points):
      
      p = points.reshape((-1, 4, 2))
      minxy = p.min(axis=1)   # nx2
      maxxy = p.max(axis=1)   # nx2
      return np.concatenate((minxy, maxxy), axis=1)
docs: Args:
          points: (nx4)x2
      Returns:
          nx4 boxes (x1y1x2y2)