Skip to content

Make validate_mask faster#84

Merged
lukas-lightly merged 1 commit into
mainfrom
lukas-lig-9640-speed-up-labelformat-pascalvoc-semantic-segmentation-loader-2
Jun 1, 2026
Merged

Make validate_mask faster#84
lukas-lightly merged 1 commit into
mainfrom
lukas-lig-9640-speed-up-labelformat-pascalvoc-semantic-segmentation-loader-2

Conversation

@lukas-lightly

@lukas-lightly lukas-lightly commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What has changed and why?

np.bincount() is faster than np.unique()

How has it been tested?

Existing tests

np.bincount() is faster than np.unique()
@lukas-lightly lukas-lightly force-pushed the lukas-lig-9640-speed-up-labelformat-pascalvoc-semantic-segmentation-loader-2 branch from 8699a01 to 27625e8 Compare June 1, 2026 11:42
@lukas-lightly

Copy link
Copy Markdown
Contributor Author

Benchmark report by Gemini:

Benchmark Results

  ┌────────┬───────────────────┬─────────────┐
  │ Branch │ Total Runtime (s) │ Improvement │
  ├────────┼───────────────────┼─────────────┤
  │ Main   │ 567.4s (~9.5 min) │ -           │
  │ PR 84  │ 323.0s (~5.4 min) │ ~43% Faster │
  └────────┴───────────────────┴─────────────┘

Summary

PR 84 demonstrates a significant performance gain, reducing the dataset ingestion time from over 9 minutes to approximately 5.5 minutes. Both runs processed the same number of samples and annotations, confirming the consistency of the benchmark.

  • PR 84 Log: loaded samples=8034 labels=101 annotations=29546 metadata_updates=8034 elapsed_s=323.0
  • Main Log: loaded samples=8034 labels=101 annotations=29546 metadata_updates=8034 elapsed_s=567.4

@lukas-lightly

Copy link
Copy Markdown
Contributor Author

/review

@MalteEbner MalteEbner mentioned this pull request Jun 1, 2026
@lukas-lightly lukas-lightly merged commit 3d2c6cd into main Jun 1, 2026
3 of 4 checks passed
@lukas-lightly lukas-lightly deleted the lukas-lig-9640-speed-up-labelformat-pascalvoc-semantic-segmentation-loader-2 branch June 1, 2026 13:40
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