Skip to content

Conversation

dhana2403
Copy link

This PR improves the evaluate function in the segmentation pipeline by computing Dice directly on class indices instead of converting masks to one-hot format.

Changes:

Removed .one_hot() conversion for mask_true and mask_pred.

Updated Dice computation to work directly on class indices.

Abstracted repeated operations into helper functions for clarity.

Benefits:

Faster execution, especially for large images or batches.

Cleaner code with fewer tensor transformations.

No change in the resulting Dice scores, numerical results remain equivalent.

Notes:

Please verify correctness of Dice computation after these changes.

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.

1 participant