Skip to content

Simplify numpy function call in object detection tutorial #1038

Closed
@ashok-arjun

Description

@ashok-arjun

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 for np.where() advises to use np.nonzero() when there is only one argument for np.where(), and it also makes the code more readable.

Metadata

Metadata

Assignees

Labels

docathon-h1-2023A label for the docathon in H1 2023easytorchvisionIssues relating to image/video tutorials

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions