Speed up granularity ~2x by only upsampling labeled voxels - #51
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=======================================
Coverage ? 94.75%
=======================================
Files ? 17
Lines ? 1658
Branches ? 0
=======================================
Hits ? 1571
Misses ? 87
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d33bs
marked this pull request as ready for review
August 12, 2026 12:06
gwaybio
approved these changes
Aug 12, 2026
gwaybio
left a comment
Member
There was a problem hiding this comment.
Great to see the speedup! A few comments, mostly on tests.
MikeLippincott
approved these changes
Aug 12, 2026
MikeLippincott
left a comment
Member
There was a problem hiding this comment.
LGTM! This will speed up "~empty" images but the images with high information content and object counts will still take a lot of time to compute.
This change will increase efficiency and increase resource requirement heterogeneity as a by product, which IMO is worth the speed up!
Co-Authored-By: Gregory Way <gregory.way@gmail.com>
Member
Author
|
Thank you @gwaybio and @MikeLippincott ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
compute_granularity was upsampling the entire subsampled image back to full resolution every scale, just to compute means over a handful of labeled objects. Now it only interpolates/scans the voxels that actually belong to a labeled object — mathematically identical result (verified byte-identical against the old implementation, plus unchanged accuracy-lock fingerprints), ~2.8x faster on real data (5.15s → 1.85s).
Also fixes a pre-existing bug in the benchmark scorecard's real-world colocalization loader (missing image_id) so the full scorecard runs end-to-end.
What kind of change(s) are included?
Checklist
Please ensure that all boxes are checked before indicating that this pull request is ready for review.