8f61e58847f3d70094e6f8622dd335d03d0c8242,RetinaFace/retinaface.py,RetinaFace,bbox_vote,#RetinaFace#Any#,569

Before Change


          det_accu_sum[:, 0:4] = np.sum(det_accu[:, 0:4],
                                        axis=0) / np.sum(det_accu[:, -1:])
          det_accu_sum[:, 4] = max_score
          try:
              dets = np.row_stack((dets, det_accu_sum))
          except:
              dets = det_accu_sum
      dets = dets[0:750, :]
      return dets

After Change


        return np.zeros( (0, 5) )
          //dets = np.array([[10, 10, 20, 20, 0.002]])
          //det = np.empty(shape=[0, 5])
      dets = None
      while det.shape[0] > 0:
          if dets is not None and dets.shape[0]>=750:
              break
          // IOU
          area = (det[:, 2] - det[:, 0] + 1) * (det[:, 3] - det[:, 1] + 1)
          xx1 = np.maximum(det[0, 0], det[:, 0])
          yy1 = np.maximum(det[0, 1], det[:, 1])
          xx2 = np.minimum(det[0, 2], det[:, 2])
          yy2 = np.minimum(det[0, 3], det[:, 3])
          w = np.maximum(0.0, xx2 - xx1 + 1)
          h = np.maximum(0.0, yy2 - yy1 + 1)
          inter = w * h
          o = inter / (area[0] + area[:] - inter)

          // nms
          merge_index = np.where(o >= self.nms_threshold)[0]
          det_accu = det[merge_index, :]
          det = np.delete(det, merge_index, 0)
          if merge_index.shape[0] <= 1:
              if det.shape[0] == 0:
                  try:
                      dets = np.row_stack((dets, det_accu))
                  except:
                      dets = det_accu
              continue
          det_accu[:, 0:4] = det_accu[:, 0:4] * np.tile(det_accu[:, -1:], (1, 4))
          max_score = np.max(det_accu[:, 4])
          det_accu_sum = np.zeros((1, 5))
          det_accu_sum[:, 0:4] = np.sum(det_accu[:, 0:4],
                                        axis=0) / np.sum(det_accu[:, -1:])
          det_accu_sum[:, 4] = max_score
          if dets is None:
              dets = det_accu_sum
          else:
              dets = np.row_stack((dets, det_accu_sum))
      dets = dets[0:750, :]
      return dets

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: deepinsight/insightface
Commit Name: 8f61e58847f3d70094e6f8622dd335d03d0c8242
Time: 2019-10-15
Author: guojia@gmail.com
File Name: RetinaFace/retinaface.py
Class Name: RetinaFace
Method Name: bbox_vote


Project Name: deepinsight/insightface
Commit Name: 24af8c5e2730c0f2d4c6cc6357a6528f4b529431
Time: 2019-10-15
Author: guojia@gmail.com
File Name: RetinaFace/retinaface.py
Class Name: RetinaFace
Method Name: bbox_vote


Project Name: Bihaqo/t3f
Commit Name: 4257bd12136ce3a135a4fab4ad0667dfccf8368d
Time: 2017-02-03
Author: novikov@bayesgroup.ru
File Name: variables.py
Class Name:
Method Name: get_tt_variable