-
-
Save arunm8489/303086f868608cd707195d414390dcad 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
#log space transform height and the width | |
anchors = torch.FloatTensor(anchors) | |
if CUDA: | |
anchors = anchors.cuda() | |
anchors = anchors.repeat(grid_size*grid_size, 1).unsqueeze(0) | |
prediction[:,:,2:4] = torch.exp(prediction[:,:,2:4])*anchors #width and height | |
prediction[:,:,5: 5 + num_classes] = torch.sigmoid((prediction[:,:, 5 : 5 + num_classes])) | |
prediction[:,:,:4] *= stride | |
return prediction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment