Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created June 5, 2020 02:47
Show Gist options
  • Save arunm8489/3271c1cf9fead1da0e99a29273f6a1fe to your computer and use it in GitHub Desktop.
Save arunm8489/3271c1cf9fead1da0e99a29273f6a1fe to your computer and use it in GitHub Desktop.
# taking only values above a particular threshold and set rest everything to zero
mask = (prediction[:,:,4] > confidence_threshold).float().unsqueeze(2)
prediction = prediction*_mask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment