当前位置:网站首页>NMS reduction box
NMS reduction box
2022-06-25 20:06:00 【Orange cedar】
import numpy as np def NMS(nums, threshold): x1 = nums[:, 0] y1 = nums[:, 1] x2 = nums[:, 2] y2 = nums[:, 3] area = (x2 - x1) * (y2 - y1) score = nums[:, 4] score = np.argsort(score)[::-1] # The function is to x The elements in are arranged from small to large , Extract the corresponding index( Indexes ), Then output to argsort() keep = [] while score.size > 0: #print("score=",score) keep.append(score[0]) # Calculation times greater than score All the frames with the largest score Of IOU xx1 = np.maximum(x1[score[0]], x1[score[1:]]) # Be careful : Here is an iterator for yy1 = np.maximum(y1[score[0]], y1[score[1:]]) xx2 = np.minimum(x2[score[0]], x2[score[1:]]) yy2 = np.minimum(y2[score[0]], y2[score[1:]]) w = np.maximum(0.0, xx2 - xx1) h = np.maximum(0.0, yy2 - yy1) # IOU overlap = w * h iou = overlap/(area[score[0]] + area[score[1:]] - overlap) # print("iou=",iou) iou_low = np.where(iou <= threshold)[0] # Returns all and maximum score Compared with <threshold The subscript # print(" Find the rectangle index whose overlap is not higher than the threshold :",iou_low) score = score[iou_low + 1] return keep
边栏推荐
- Appearance of object attributes
- CG kit explore high performance rendering on mobile terminal
- 2.14(Knight Moves)
- Applet wx Request encapsulation
- PAT B1059
- Life cycle function of composite API
- 手机开户股票安全吗,买股票在哪开户?
- A necessary programming assistant for programmers! Smartcoder helps you easily integrate HMS core
- String since I can perform performance tuning, I can call an expert directly
- Force wechat page font size to be 100%
猜你喜欢
Use of serialize() and serializearray() methods for form data serialization
Web container basic configuration
Jsonp non homologous interaction (click trigger)
Jsonp processing non homologous
Print 1 cute every 100 milliseconds ~ with a running lantern effect
Wechat applet swiper simple local picture display appears large blank
LNMP compilation and installation
2.3 partial sum of square and reciprocal sequences
Avoid material "minefields"! Play super high conversion rate
<C>. Figure guessing game
随机推荐
Applet multi image to Base64 upload
2.2 step tariff
Is it safe to open a new bond securities account
Arduino read temperature
PAT B1066
Appearance of object attributes
Mysql database design suggestions
PAT B1081
Vulnhub range - darkhole 1
<C>. Rolling phase division
Redis high availability: do you call this the principle of master-slave architecture data synchronization?
Yum command
Vulnhub range - correlation:2
Applet wx Request encapsulation
Jsonp function encapsulation
Connect the local browser to the laboratory server through mobaxterm
Is it safe to open an online account for new bonds? What should be paid attention to
6. exception handling
The native JS mobile phone sends SMS cases. After clicking the button, the mobile phone number verification code is sent. The button needs to be disabled and re enabled after 60 seconds
Applet Click to return to the top 2 methods