Exemple #1
0
 def __init__(self,
              iou_thresh=0.5,
              neg_thresh=0.5,
              negative_mining_ratio=3,
              stds=(0.1, 0.1, 0.2, 0.2),
              **kwargs):
     super(SSDTargetGenerator, self).__init__(**kwargs)
     self._matcher = CompositeMatcher(
         [BipartiteMatcher(share_max=False),
          MaximumMatcher(iou_thresh)])
     if negative_mining_ratio > 0:
         self._sampler = OHEMSampler(negative_mining_ratio,
                                     thresh=neg_thresh)
         self._use_negative_sampling = True
     else:
         self._sampler = NaiveSampler()
         self._use_negative_sampling = False
     self._cls_encoder = MultiClassEncoder()
     self._box_encoder = NormalizedBoxCenterEncoder(stds=stds)
     self._center_to_corner = BBoxCenterToCorner(split=False)