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

Speed up semantic segmentation annotations loading #205

Merged
merged 9 commits into from
Nov 8, 2024

Conversation

sokovninn
Copy link
Member

@sokovninn sokovninn commented Nov 7, 2024

This PR includes:

  • Optimized computation for detecting unassigned labels to streamline automatic background addition.
  • Improved performance of the SegmentationAnnotation.combine_to_numpy() function.

Loader benchmarks (1 worker, 5000 images):

  • unassigned_pixels = np.sum(array, axis=0) == 0 - 3:15 (previous)
  • unassigned_pixels = ~np.any(array, axis=0) - 1:58 (new)
  • Without adding background - 1:35
  • Optimized background and optimized SegmentationAnnotation.combine_to_numpy() - 1:45

Training benchmarks (1 epoch, 5000 images, 8 workers):

  • Without optimization: 2:46
  • With optimizations: 2:37
  • Dummy labels: 0:56

@sokovninn sokovninn requested a review from a team as a code owner November 7, 2024 22:36
@sokovninn sokovninn requested review from kozlov721, klemen1999, tersekmatija and conorsim and removed request for a team November 7, 2024 22:36
@github-actions github-actions bot added the enhancement New feature or request label Nov 7, 2024
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.26%. Comparing base (6bcbb11) to head (1a9ed09).
Report is 15 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #205      +/-   ##
==========================================
- Coverage   92.33%   92.26%   -0.08%     
==========================================
  Files          79       80       +1     
  Lines        4161     4265     +104     
==========================================
+ Hits         3842     3935      +93     
- Misses        319      330      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sokovninn sokovninn merged commit bfd3bbc into main Nov 8, 2024
11 of 12 checks passed
@sokovninn sokovninn deleted the feat/speedup-sem-seg-loading branch November 8, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants