From 24b6d065bb105cb1155e782e4a1697ac8392f9eb Mon Sep 17 00:00:00 2001 From: xyxzjhjy <31675186+xyxzjhjy@users.noreply.github.com> Date: Thu, 5 Jul 2018 12:58:19 +0800 Subject: [PATCH] Update nums_py2.pyx Fix bugs, thus the speed is normal --- nms/nums_py2.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nms/nums_py2.pyx b/nms/nums_py2.pyx index e6aea50..abd8c96 100644 --- a/nms/nums_py2.pyx +++ b/nms/nums_py2.pyx @@ -35,7 +35,7 @@ def py_cpu_nms(np.ndarray[np.float32_t,ndim=2] dets, np.float thresh): cdef int _i, _j cdef int i, j - + cdef np.float32_t xx1, yy1, xx2, yy2 cdef np.float32_t ix1, iy1, ix2, iy2, iarea cdef np.float32_t w, h cdef np.float32_t overlap, ious @@ -62,8 +62,8 @@ def py_cpu_nms(np.ndarray[np.float32_t,ndim=2] dets, np.float thresh): continue xx1 = max(ix1, x1[j]) yy1 = max(iy1, y1[j]) - xx2 = max(ix2, x2[j]) - yy2 = max(iy2, y2[j]) + xx2 = min(ix2, x2[j]) + yy2 = min(iy2, y2[j]) w = max(0.0, xx2-xx1+1) h = max(0.0, yy2-yy1+1) @@ -95,4 +95,4 @@ def plot_bbox(dets, c='k'): #plot_bbox(boxes[keep], 'r')# after nms - \ No newline at end of file +