Skip to content

Commit

Permalink
fixing cyto2 CLI (#257) and masks_flows_to_seg bug (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
carsen-stringer committed May 5, 2021
1 parent 4a693d2 commit 4b1eaa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cellpose/__main__.py
Expand Up @@ -127,7 +127,7 @@ def main():

if not args.train and not args.train_size:
tic = time.time()
if not (args.pretrained_model=='cyto' or args.pretrained_model=='nuclei'):
if not (args.pretrained_model=='cyto' or args.pretrained_model=='nuclei' or args.pretrained_model=='cyto2'):
cpmodel_path = args.pretrained_model
if not os.path.exists(cpmodel_path):
logger.warning('model path does not exist, using cyto model')
Expand All @@ -154,7 +154,10 @@ def main():
logger.info('>>>> running cellpose on %d images using chan_to_seg %s and chan (opt) %s'%
(nimg, cstr0[channels[0]], cstr1[channels[1]]))

if args.pretrained_model=='cyto' or args.pretrained_model=='nuclei':
if args.pretrained_model=='cyto' or args.pretrained_model=='nuclei' or args.pretrained_model=='cyto2':
if args.mxnet and args.pretrained_model=='cyto2':
logger.warning('cyto2 model not available in mxnet, using cyto model')
args.pretrained_model = 'cyto'
model = models.Cellpose(gpu=gpu, device=device, model_type=args.pretrained_model,
torch=(not args.mxnet))
else:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_train.py
Expand Up @@ -2,6 +2,9 @@
from pathlib import Path
from subprocess import check_output, STDOUT
import os, shutil
import os

os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"

def test_class_train(data_dir, image_names):
train_dir = str(data_dir.joinpath('2D').joinpath('train'))
Expand Down

0 comments on commit 4b1eaa3

Please sign in to comment.