MCPcopy Create free account
hub / github.com/amdegroot/ssd.pytorch / point_form

Function point_form

layers/box_utils.py:5–14  ·  view source on GitHub ↗

Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data. Args: boxes: (tensor) center-size default boxes from priorbox layers. Return: boxes: (tensor) Converted xmin, ymin, xmax, ymax form of boxes.

(boxes)

Source from the content-addressed store, hash-verified

3
4
5def point_form(boxes):
6 """ Convert prior_boxes to (xmin, ymin, xmax, ymax)
7 representation for comparison to point form ground truth data.
8 Args:
9 boxes: (tensor) center-size default boxes from priorbox layers.
10 Return:
11 boxes: (tensor) Converted xmin, ymin, xmax, ymax form of boxes.
12 """
13 return torch.cat((boxes[:, :2] - boxes[:, 2:]/2, # xmin, ymin
14 boxes[:, :2] + boxes[:, 2:]/2), 1) # xmax, ymax
15
16
17def center_size(boxes):

Callers 1

matchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected