Skip to content

Commit 2bd7ee5

Browse files
committed
style(formatting): box_utils/ssd_target_transform
1 parent 7a7de93 commit 2bd7ee5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

py/ssd/data/transforms/ssd_target_transform.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ def __call__(self, gt_boxes, gt_labels):
2525
gt_boxes = torch.from_numpy(gt_boxes)
2626
if type(gt_labels) is np.ndarray:
2727
gt_labels = torch.from_numpy(gt_labels)
28-
boxes, labels = box_utils.assign_priors(gt_boxes, gt_labels,
29-
self.corner_form_priors, self.iou_threshold)
28+
# boxes: [num_priors, 4] 每个先验框对应的标注框坐标
29+
# labels: [num_priors] 每个先验框对应标签
30+
boxes, labels = box_utils.assign_priors(gt_boxes, gt_labels, self.corner_form_priors, self.iou_threshold)
3031
boxes = box_utils.corner_form_to_center_form(boxes)
3132
locations = box_utils.convert_boxes_to_locations(boxes, self.center_form_priors, self.center_variance,
3233
self.size_variance)

py/ssd/utils/box_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
import math
1212

1313

14-
def convert_locations_to_boxes(locations, priors, center_variance,
15-
size_variance):
14+
def convert_locations_to_boxes(locations, priors, center_variance, size_variance):
1615
"""Convert regressional location results of SSD into boxes in the form of (center_x, center_y, h, w).
1716
1817
The conversion:

0 commit comments

Comments
 (0)