def __call__(self, gt_boxes, gt_labels):
     boxes, labels = box_utils.assign_priors(gt_boxes, gt_labels,
                                             self.corner_form_priors,
                                             self.iou_threshold)
     boxes = box_utils.corner_form_to_center_form(boxes)
     locations = box_utils.convert_boxes_to_locations(
         boxes, self.center_form_priors, self.center_variance,
         self.size_variance)
     return locations, labels
Esempio n. 2
0
 def __call__(self, gt_boxes, gt_labels):
     if type(gt_boxes) is np.ndarray:
         gt_boxes = torch.from_numpy(gt_boxes)
     if type(gt_labels) is np.ndarray:
         gt_labels = torch.from_numpy(gt_labels)
     boxes, labels = box_utils.assign_priors(gt_boxes, gt_labels,
                                             self.corner_form_priors, self.iou_threshold)
     boxes = box_utils.corner_form_to_center_form(boxes)
     locations = box_utils.convert_boxes_to_locations(boxes, self.center_form_priors, self.center_variance, self.size_variance)
     return locations, labels