예제 #1
0
 def fn(x):
     boxes, num_boxes = x
     boxes = boxes[:num_boxes]
     # if the images are padded we need to rescale groundtruth boxes:
     boxes = boxes * self.box_scaler
     reg_targets, matches = get_training_targets(
         self.anchors, boxes, threshold=MATCHING_THRESHOLD)
     return reg_targets, matches
예제 #2
0
 def fn(x):
     boxes, labels, num_boxes = x
     boxes, labels = boxes[:num_boxes], labels[:num_boxes]
     labels = tf.one_hot(labels,
                         self.num_classes,
                         axis=1,
                         dtype=tf.float32)
     cls_targets, reg_targets, matches = get_training_targets(
         self.anchors,
         boxes,
         labels,
         self.num_classes,
         threshold=MATCHING_THRESHOLD)
     return cls_targets, reg_targets, matches
예제 #3
0
 def fn(x):
     boxes, num_boxes = x
     boxes = boxes[:num_boxes]
     reg_targets, matches = get_training_targets(
         self.anchors, boxes, threshold=MATCHING_THRESHOLD)
     return reg_targets, matches