Simplify numpy function call in object detection tutorial #1038
Labels
docathon-h1-2023
A label for the docathon in H1 2023
easy
torchvision
Issues relating to image/video tutorials
In the second code block in the tutorial, the line
pos = np.where(masks[i])
has been used to get the indices of the non zero points in the image. But numpy documentation fornp.where()
advises to usenp.nonzero()
when there is only one argument fornp.where()
, and it also makes the code more readable.The text was updated successfully, but these errors were encountered: