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

Always return the same data type #425

Open
chrisroat opened this issue Jan 19, 2022 · 0 comments
Open

Always return the same data type #425

chrisroat opened this issue Jan 19, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@chrisroat
Copy link
Contributor

I noticed this in the recent release:

added support for >2^16 masks with np.uint32, if there are <2^16 masks then the masks are returned as np.uint16 still

This makes it extremely hard to use in a distributed setting like dask where they data types must be known in advance and should be the same for every chunk (you are effectively indicating that data chunks with fewer masks may be a different data type).

If you are internally using a bigger data type and changing it when #masks<2**16, then this is a pre-optimization that people may not need -- you can just leave that optimization to the user anyway.

It would be nice to use that same standard as scikit-image, and always return the same data type (preferable signed). This allows a user to "drop in" cellpose to their code without having to potentially rework around the API.

@chrisroat chrisroat changed the title Always return the same size Always return the same data type Jan 19, 2022
@carsen-stringer carsen-stringer added the enhancement New feature or request label Feb 12, 2022
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

No branches or pull requests

2 participants