Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created June 5, 2020 02:49
Show Gist options
  • Save arunm8489/b48a0d0a1ec553f1d351b33b4d68db66 to your computer and use it in GitHub Desktop.
Save arunm8489/b48a0d0a1ec553f1d351b33b4d68db66 to your computer and use it in GitHub Desktop.
#(center x, center y, height, width) attributes of our boxes,
#to (top-left corner x, top-left corner y, right-bottom corner x, right-bottom corner y)
box_corner = prediction.new(prediction.shape)
box_corner[:,:,0] = (prediction[:,:,0] - prediction[:,:,2]/2)
box_corner[:,:,1] = (prediction[:,:,1] - prediction[:,:,3]/2)
box_corner[:,:,2] = (prediction[:,:,0] + prediction[:,:,2]/2)
box_corner[:,:,3] = (prediction[:,:,1] + prediction[:,:,3]/2)
prediction[:,:,:4] = box_corner[:,:,:4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment