soft-nms 与 nms
1. nms
nms流程:
- 遍历所有的box
- 找到置信度(score)最大的box
- 遍历剩下的box
- 如果其iou > 阈值 ——> 删除该框
2. soft-nms
soft-nms流程:
- 遍历所有的box
- 找到置信度(score)最大的box
- 遍历剩下的box
- 如果其iou > 阈值 ——> 降低置信度
- 降低置信度实现
-
- 线性:
f ( x ) = { s i = s i , i o u ( B m a x , B i ) < t h r e s i = s i ∗ ( 1 − i o u ( B m a x , B i ) ) , i o u ( B m a x , B i ) ≥ t h r e f(x)=\left\{ \begin{aligned} s_i = s_i&, iou(B_{max},B_i) < thre \\ s_i = s_i*(1 - iou(B_{max},B_i))&, iou(B_{max},B_i) \ge thre \end{aligned} \right. f(x)={si=sisi=si∗(1−iou(Bmax,Bi)),iou(Bmax,Bi)<thre,iou(Bmax,Bi)≥thre
- 线性:
-
- 高斯加权
s i = s i e − i o u ( B m a x , B i ) 2 σ s_i = s_i e ^{-\frac{iou(B_{max},B_i)^2}{\sigma}} si=sie−σiou(Bmax,Bi)2