赞
踩
import numpy as np
def nms(dets,score):
x1 = dets[:,0]
y1 = dets[:,1]
x2 = dets[:,2]
y2 = dets[:,3]
area = (x2-x1+1)*(y2-y1+1)
scores = dets[:,4]
idx = scores.argsort()[::-1]
keep = []
while idx.size > 0:
i = idx[0]
keep.append(i)
xx1 = np.maximum(x1[i],x1[idx[1:]])
xx2 = np.minimum(x2[i],x2[idx[1:]])
yy1 = np.maximum(y1[i],y1[idx[1:]])
yy2 = np.minimum(y2[i],y2[idx[1:]])
w = np.maximum(xx2-xx1,0)
h = np.maximum(yy2-yy1,0)
overlap = w*h
iou = overlap/(area[i]+area[idx[1:]]-overlap)
idx_i = np.where(iou<=score_thr)[0]
idx = idx[idx_i+1]
return keep
【深度学习】VAE(Variational Auto-Encoder)原理
Multi-headed Self-attention(多头自注意力)机制介绍
【论文&模型讲解】CLIP(Learning Transferable Visual Models From Natural Language Supervision)
VAE 模型基本原理简单介绍(常用于异常检测)
GAN(生成对抗网络)的系统全面介绍
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。