[关闭]
@devilloser 2018-09-10T06:25:14.000000Z 字数 596 阅读 993

SSD detection

deeplearning


anchor box生成

以38*38的feature map为例
step 1
初始化x,y

  1. y=array([[0,0.....0],
  2. [1,1.....1],
  3. .....
  4. [38,38...38]])
  5. x=array([[0,1,....38],
  6. [0,1,....38],
  7. ...
  8. [0,1,....38]])

将x,y归一到0-1

  1. y=(y+offset)*step/img_shape[0] #step为img_shape[0]/feature_shape[0]

初始化w,h

ground truth预处理

计算ymin,ymax,xmin,xmax
计算IoU
保留大于threshold大小的anchor box作为正样本

计算loss

SSD目标函数分为两个部分:对应默认框的位置loss(loc)和类别置信度loss(conf)。定义

为第i个默认框和对应的第j个ground truth box,相应的类别为p。目标函数定义为:
此处输入图片的描述http://www.zhihu.com/equation?tex=L%28x%2Cc%2Cl%2Cg%29%3D%5Cfrac%7B1%7D%7BN%7D%28L_%7Bconf%7D%28x%2Cc%29%2B%5Calpha+L_%7Bloc%7D%28x%2Cl%2Cg%29+%29

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注