Skip to content

Commit

Permalink
bug in size estimation channel setting
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed Oct 1, 2020
1 parent 8134fb4 commit 17b9490
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cellpose/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def eval(self, imgs=None, styles=None, channels=None, normalize=True, invert=Fal
nimg = len(x)

if styles is None:
styles = self.cp.eval(x, channels=channels, net_avg=False, augment=augment, tile=tile, compute_masks=False)[-1]
styles = self.cp.eval(x, net_avg=False, augment=augment, tile=tile, compute_masks=False)[-1]
if progress is not None:
progress.setValue(30)
diam_style = self._size_estimation(np.array(styles))
Expand All @@ -1369,7 +1369,7 @@ def eval(self, imgs=None, styles=None, channels=None, normalize=True, invert=Fal
diam_style[np.isnan(diam_style)] = self.diam_mean

if imgs is not None:
masks = self.cp.eval(x, channels=channels, rescale=self.diam_mean/diam_style, net_avg=False,
masks = self.cp.eval(x, rescale=self.diam_mean/diam_style, net_avg=False,
augment=augment, tile=tile)[0]
diam = np.array([utils.diameters(masks[i])[0] for i in range(nimg)])
if progress is not None:
Expand Down

0 comments on commit 17b9490

Please sign in to comment.