Skip to content

vectorize iou computation#398

Merged
dpascualhe merged 4 commits intoJdeRobot:masterfrom
Bissmella:iou_parallelized
Mar 25, 2026
Merged

vectorize iou computation#398
dpascualhe merged 4 commits intoJdeRobot:masterfrom
Bissmella:iou_parallelized

Conversation

@Bissmella
Copy link
Copy Markdown
Contributor

@Bissmella Bissmella commented Mar 3, 2026

Closes #377

This PR replaces the double for-loop implementation of compute_iou_matrix and compute_iou with a fully vectorized Numpy broadcasting approach.

Changes:

  • Implemented vectorized pairwise IoU computation
  • Added unit tests verifying equivalence with the reference implementation

@dpascualhe
@Arkadeep455

@dpascualhe
Copy link
Copy Markdown
Collaborator

Hi @Bissmella ! I think you messed up your PR, can you please clean it up and regenerate your changes?

@Bissmella
Copy link
Copy Markdown
Contributor Author

Hi @dpascualhe, Oups yeah I see. I will fix it now.

@Bissmella
Copy link
Copy Markdown
Contributor Author

Bissmella commented Mar 12, 2026

now fixed. There was a confilct and resolving that had caused a mess.

@dpascualhe
Copy link
Copy Markdown
Collaborator

dpascualhe commented Mar 16, 2026

Good work with the conflict resolution but this comment is still not addressed:

Careful! You have moved compute_iou to the test suite. Move it back to the detection_metrics module

Also, please just a single test per function, otherwise the test suite becomes really hard to maintain. Thanks for your efforts!

@Bissmella
Copy link
Copy Markdown
Contributor Author

I moved back the compute_iou, and shortened the test to a single function.

Copy link
Copy Markdown
Collaborator

@dpascualhe dpascualhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking better. Please format it using black and we are ready to go!

Comment thread tests/test_segmentation_metrics.py Outdated
@Bissmella
Copy link
Copy Markdown
Contributor Author

Formatted with black.

@dpascualhe dpascualhe merged commit 38572a9 into JdeRobot:master Mar 25, 2026
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.

Vectorize compute_iou_matrix with NumPy

2 participants