Research Article

An Efficient Anchor-Free Face Detector with Attention Mechanisms

Algorithm 1

Positive sample matching process.
Input:
is a set of range numbers
is a set of bounding boxes in the input image
is a set of pixel maps’ strides
Output:
is the kth pixel map
(1)for each level do
(2) build a mesh grid Mi according to the stride at kth level
(3)for each pixel xi, yi ∈ Mido
(4)  calculate the pixel center coordinate xc, yc
(5)  for each bounding box  ∈ do
(6)   if xc, yc locates within then
(7)    compute distances d = (l, t, r, b) from the pixel center to the box’s boundary
(8)    if < max(l, t, r, b) < then
(9)     if the pixel xi, yi has not been marked positive then
(10)      mark the pixel xi, yi in a positive sample, assign regression target d, classification target t and centerness score c
(11)     else
(12)      compare 4 distances l, t, r, b with target d and replace with l, t, r, b if the corresponding value in d is larger.
(13)     end if
(14)    end if
(15)   end if
(16)  end for
(17)end for
(18)end for