parameters: (quad, begin_width_ratio=0., end_width_ratio=1.)
return_statement: return np.array([p0_1[0], p0_1[1], p3_2[1], p3_2[0]])
docstring: Generate shrink_quad_along_width.
docstring_summary: Generate shrink_quad_along_width.
docstring_tokens: Generate shrink_quad_along_width .
function: def shrink_quad_along_width(quad, begin_width_ratio=0., end_width_ratio=1.):
      """
      Generate shrink_quad_along_width.
      """
      ratio_pair = np.array(
          [[begin_width_ratio], [end_width_ratio]], dtype=np.float32)
      p0_1 = quad[0] + (quad[1] - quad[0]) * ratio_pair
      p3_2 = quad[3] + (quad[2] - quad[3]) * ratio_pair
      return np.array([p0_1[0], p0_1[1], p3_2[1], p3_2[0]])
function_tokens: def shrink_quad_along_width ( quad , begin_width_ratio = 0. , end_width_ratio = 1. ) : ratio_pair = np . array ( [ [ begin_width_ratio ] , [ end_width_ratio ] ] , dtype = np . float32 ) p0_1 = quad [ 0 ] + ( quad [ 1 ] - quad [ 0 ] ) * ratio_pair p3_2 = quad [ 3 ] + ( quad [ 2 ] - quad [ 3 ] ) * ratio_pair return np . array ( [ p0_1 [ 0 ] , p0_1 [ 1 ] , p3_2 [ 1 ] , p3_2 [ 0 ] ] )