-
-
Save arunm8489/9fd74bc73e39a437f93833e5e4f94d58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add the center offsets | |
grid = np.arange(grid_size) | |
a,b = np.meshgrid(grid, grid) | |
x_offset = torch.FloatTensor(a).view(-1,1) #(1,gridsize*gridsize,1) | |
y_offset = torch.FloatTensor(b).view(-1,1) | |
if CUDA: | |
x_offset = x_offset.cuda() | |
y_offset = y_offset.cuda() | |
x_y_offset = torch.cat((x_offset, y_offset), 1).repeat(1,num_anchors).view(-1,2).unsqueeze(0) | |
prediction[:,:,:2] += x_y_offset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment