Skip to content

Commit

Permalink
fixing coverall command
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed May 1, 2021
1 parent ff46c5f commit 8b52f24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ install:
- pip install matplotlib
- pip install coveralls
script:
- coverage run --source=cellpose --omit=cellpose/gui.py,cellpose/guiparts.py,cellpose/menus.py,cellpose/__main__.py
- coverage run --source=cellpose --omit=cellpose/gui/gui.py,cellpose/gui/guiparts.py,cellpose/gui/io.py,cellpose/gui/menus.py,cellpose/__main__.py
setup.py test
after_success: coveralls
deploy:
Expand Down
8 changes: 5 additions & 3 deletions cellpose/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ def __init__(self, gpu=False, model_type='cyto', net_avg=True, device=None, torc
self.device = device if device is not None else sdevice
self.gpu = gpu
model_type = 'cyto' if model_type is None else model_type
if model_type=='cyto2' and not self.torch:
model_type='cyto'
self.pretrained_model = [os.fspath(model_dir.joinpath('%s%s_%d'%(model_type,torch_str,j))) for j in range(4)]
self.pretrained_size = os.fspath(model_dir.joinpath('size_%s%s_0.npy'%(model_type,torch_str)))
self.diam_mean = 30. if model_type=='cyto' else 17.
self.diam_mean = 30. if model_type!='nuclei' else 17.

if not net_avg:
self.pretrained_model = self.pretrained_model[0]
Expand Down Expand Up @@ -234,7 +236,7 @@ def eval(self, x, batch_size=8, channels=None, channel_axis=None, z_axis=None,
else:
diam_string = '[ %0.2f ]'%diams
models_logger.info(diam_string)
else:
elif estimate_size:
if self.pretrained_size is None:
reason = 'no pretrained size model specified in model Cellpose'
else:
Expand Down Expand Up @@ -315,7 +317,7 @@ def __init__(self, gpu=False, pretrained_model=False,

if model_type is not None or (pretrained_model and not os.path.exists(pretrained_model[0])):
pretrained_model_string = model_type
if (pretrained_model_string !='cyto' and pretrained_model_string !='nuclei') or pretrained_model_string is None:
if (pretrained_model_string !='cyto' and pretrained_model_string !='nuclei' and pretrained_model_string != 'cyto2') or pretrained_model_string is None:
pretrained_model_string = 'cyto'
pretrained_model = None
if (pretrained_model and not os.path.exists(pretrained_model[0])):
Expand Down

0 comments on commit 8b52f24

Please sign in to comment.