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

Error for min_size #280

Closed
shan-stat opened this issue Jul 1, 2021 · 2 comments
Closed

Error for min_size #280

shan-stat opened this issue Jul 1, 2021 · 2 comments

Comments

@shan-stat
Copy link

Hi, thanks for developing the excellent program.

I tried to use the min_size argument in models.Cellpose.eval() function, but I think it did not work.
Please show the following results. Even though a mask consists of 82 pixels and the min_size argument is set to 100, the mask is not removed. Could you check this issue? Thanks.


masks, flows, styles, diams = model.eval(img, diameter=20, channels=channels, flow_threshold=0.7, cellprob_threshold=-2, resample=True, min_size=15)
processing 1 image(s)
time spent: running network 2.58s; flow+mask computation 2.25
estimated masks for 1 image(s) in 4.89 sec

TOTAL TIME 4.89 sec
masks.max()
301
len(np.where(masks==4)[0])
82
len(np.where(masks==4)[1])
82

masks, flows, styles, diams = model.eval(img, diameter=20, channels=channels, flow_threshold=0.7, cellprob_threshold=-2, resample=True, min_size=100)
processing 1 image(s)
time spent: running network 2.58s; flow+mask computation 2.25
estimated masks for 1 image(s) in 4.88 sec

TOTAL TIME 4.88 sec
masks.max()
301
len(np.where(masks==4)[0])
82
len(np.where(masks==4)[1])
82


@GFleishman
Copy link

Just curious why this issue was closed? I have some questions about min_size as well; though have not observed this specific problem.

@ashishUthama
Copy link

I notice the same issue - Explicitly set min_size is ignored for 2D (defaults to 15).

Traced this to the following call where min_size is not propagated to dynamics.compute_masks in the 2D case:

outputs = dynamics.compute_masks(dP[:,i], cellprob[i], niter=niter, cellprob_threshold=cellprob_threshold,

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

No branches or pull requests

3 participants