MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / point4_to_box

Function point4_to_box

examples/FasterRCNN/common.py:80–90  ·  view source on GitHub ↗

Args: points: (nx4)x2 Returns: nx4 boxes (x1y1x2y2)

(points)

Source from the content-addressed store, hash-verified

78
79
80def point4_to_box(points):
81 """
82 Args:
83 points: (nx4)x2
84 Returns:
85 nx4 boxes (x1y1x2y2)
86 """
87 p = points.reshape((-1, 4, 2))
88 minxy = p.min(axis=1) # nx2
89 maxxy = p.max(axis=1) # nx2
90 return np.concatenate((minxy, maxxy), axis=1)
91
92
93def polygons_to_mask(polys, height, width):

Callers 1

__call__Method · 0.90

Calls 2

minMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…