图中网格为13x13,即grid_size = 13。
将每个网格用(x,y)坐标表示。
grid = np.arrange(grid_size)
a, b = np.meshgrid(grid, grid)
#a,b 均为13x13矩阵
x_offset = torch.FloatTensor(a).view(-1, 1)
y_offset = torch.FloatTensor(b).view(-1, 1)
x_y_offset = torch.cat((x_offset, y_offset), 1).repeat(1, num_anchors).view(-1, 2).unsqueeze(0)
'''
( 0 ,.,.) =
0 0
0 0
0 0
⋮
12 12
12 12
12 12
[torch.FloatTensor of size 1x507x2]
'''