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

feat: use tinybrain for image downsampling #894

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

supersergiy
Copy link
Member

fixes #737

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (2e0f8be) to head (9cbdff5).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #894   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          142       142           
  Lines         6102      6104    +2     
=========================================
+ Hits          6102      6104    +2     

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

@@ -388,7 +388,7 @@ def interpolate( # pylint: disable=too-many-locals
allow_slice_rounding=allow_slice_rounding,
)

if mode == "segmentation" and (
if mode in ("segmentation", "img", "bilinear") and (
Copy link
Collaborator

@nkemnitz nkemnitz Feb 6, 2025

Choose a reason for hiding this comment

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

It's not going to break things, but tinybrain has no C implementation for signed integer type averaging (e.g. our image encodings). Normally don't need to downsample these - only for misalignment detection.

If I read it correctly, tinybrain will convert such cases to fp32 and use numpy based interpolation, which is probably slower than torch+CUDA

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed via seung-lab/tinybrain#22

@supersergiy
Copy link
Member Author

cc seung-lab/tinybrain#22

@supersergiy supersergiy requested a review from nkemnitz February 7, 2025 18:30
@supersergiy supersergiy force-pushed the sergiy/use_tinybrain_for_img_downs branch from fb57c5a to 14ab282 Compare February 7, 2025 18:36
@supersergiy supersergiy force-pushed the sergiy/use_tinybrain_for_img_downs branch from 14ab282 to 9cbdff5 Compare February 7, 2025 19:05
@supersergiy supersergiy merged commit dc36c85 into main Feb 7, 2025
10 checks passed
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.

2D downsampling of uint8 data inefficient
2 participants