Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update box3d_nms.py #11

Closed
wants to merge 1 commit into from
Closed

Conversation

gautam1858
Copy link

@gautam1858 gautam1858 commented Oct 27, 2023

  1. Precomputed common values such as num_classes, thr_hi, and thr_lo, are computed within the loop. It's more efficient to compute them once outside the loop.
  2. Used list comprehensions to simplify and optimize the creation of lists like bboxes, scores, and labels.
  3. Instead of repeatedly converting NumPy arrays to PyTorch tensors in the loop, convert them once outside the loop.
  4. Avoided Concatenating Tensors in a Loop: Concatenating tensors in a loop is inefficient. Instead, accumulated the results in lists and concatenated them once outside the loop.
  5. Used torch.nonzero for Indexing: Instead of manually iterating through indices, used torch.nonzero to find the indices of non-zero elements. 6.Removed the loop for class iteration.
  6. Applied vectorized filtering and NMS operations.
  7. Vectorized for loop for faster computation

 Precompute Common Values: Some values, such as num_classes, thr_hi, and thr_lo, are computed within the loop. It's more efficient to compute them once outside the loop.
Used List Comprehension to simplify and optimize the creation of lists like bboxes, scores, and labels.

Avoided Using torch.from_numpy Repeatedly: Instead of repeatedly converting NumPy arrays to PyTorch tensors in the loop, convert them once outside the loop.

Avoided Concatenating Tensors in a Loop - Concatenating tensors in a loop is inefficient. Instead, accumulated the results in lists and concatenated them once outside the loop.

Used torch.nonzero for Indexing: Instead of manually iterating through indices, use torch.nonzero to find the indices of non-zero elements.                                                                                             Removed the loop for class iteration. 
Applied vectorized filtering and NMS operations.
@mihaimaruseac
Copy link

This looks like another spam PR (author has already sent 3 such PRs to TensorFlow and 3 to Keras and 1 to deepmind).

@gautam1858
Copy link
Author

This looks like another spam PR (author has already sent 3 such PRs to TensorFlow and 3 to Keras and 1 to deepmind).

@mihaimaruseac this commit has changes and not a spam such messages discourages open source contributions. Request relevant author to make comments.

@mihaimaruseac
Copy link

This looks like another spam PR (author has already sent 3 such PRs to TensorFlow and 3 to Keras and 1 to deepmind).

@mihaimaruseac this commit has changes and not a spam such messages discourages open source contributions. Request relevant author to make comments.

You only added a new function with the same API as the existing one. None of the changes are relevant, including the fact that you are adding new imports in the middle of the code.

This looks like a PR generated by ChatGPT, just spam, just like keras-team/keras#18674, tensorflow/tensorflow#62230, tensorflow/tensorflow#62199, tensorflow/tensorflow#62157, keras-team/keras#18673, keras-team/keras#18646, onnx/onnx#5715, sigstore/model-transparency#62, aws/sagemaker-python-sdk#4216, OpenMined/PySyft#8175, and google-deepmind/dm_control#431 (so far)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants