CLI#
See command line examples for typical use cases.
usage: omnipose [image args] [model args] [...]
input image arguments#
- --dir
folder containing data on which to run or train
- --look_one_level_down
run processing on all subdirectories of current folder
- --mxnet
use mxnet
- --img_filter
filter images by this suffix
- --channel_axis
axis of image which corresponds to image channels
- --z_axis
axis of image which corresponds to Z dimension
- --chan
channel to segment; 0: GRAY, 1: RED, 2: GREEN, 3: BLUE. Default: 0
- --chan2
nuclear channel (if cyto, optional); 0: NONE, 1: RED, 2: GREEN, 3: BLUE. Default: 0
- --invert
invert grayscale channel
- --all_channels
use all channels in image if using own model and images with special channels
- --dim
number of spatiotemporal dimensions of images (not counting channels). Default: 2
model arguments#
- --pretrained_model
model to use
- --unet
run standard unet instead of cellpose flow output
- --nclasses
number of prediction classes for model (3 for Cellpose, 4 for Omnipose boundary field)
- --nchan
number of channels on which model is trained
- --kernel_size
kernel size for maskpool. Starts at 2, higher means more aggressive downsampling.
algorithm arguments#
- --omni
Omnipose algorithm (disabled by default)
- --affinity_seg
use new affinity segmentation algorithm (disabled by default)
- --cluster
DBSCAN clustering. Reduces oversegmentation of thin features (disabled by default)
- --no_suppress
Euler integration 1/t suppression reduces oversegmentation but can give undersegmentation in 3D; this flag disables it.
- --fast_mode
make code run faster by turning off 4 network averaging and resampling
- --no_resample
disable dynamics on full image (makes algorithm faster for images with large diameters)
- --no_net_avg
make code run faster by only running 1 network
- --no_interp
do not interpolate when running dynamics (was default)
- --do_3D
process images as 3D stacks of images (nplanes x nchan x Ly x Lx
- --diameter
cell diameter, 0 disables unless sizemodel is present. Default: 0.0
- --rescale
image rescaling factor (r = diameter / model diameter)
- --stitch_threshold
compute masks in 2D then stitch together masks with IoU>0.9 across planes
- --flow_threshold
flow error threshold, 0 turns off this optional QC step. Default: 0.4
- --mask_threshold
mask threshold, default is 0, decrease to find more and larger masks
- --niter
Number of Euler iterations, enter value to override Omnipose diameter estimation (under/over-segment)
- --anisotropy
anisotropy of volume in 3D
- --diam_threshold
cell diameter threshold for upscaling before mask rescontruction, default 12
- --exclude_on_edges
discard masks which touch edges of image
- --min_size
minimum size for masks, helps if small debris is labeled
- --max_size
maximum size for masks, helps if background patches are labeled
output arguments#
- --save_png
save masks as png
- --save_tif
save masks as tif
- --no_npy
suppress saving of npy
- --savedir
folder to which segmentation results will be saved (defaults to input image directory)
- --dir_above
save output folders adjacent to image folder instead of inside it (off by default)
- --in_folders
flag to save output in folders (off by default)
- --save_flows
whether or not to save RGB images of flows when masks are saved (disabled by default)
- --save_outlines
whether or not to save RGB outline images when masks are saved (disabled by default)
- --save_ncolor
whether or not to save minimal "n-color" masks (disabled by default
- --save_txt
flag to enable txt outlines for ImageJ (disabled by default)
- --transparency
store flows with background transparent (alpha=flow magnitude) (disabled by default)
training arguments#
- --train
train network using images in dir
- --train_size
train size network at end of training
- --mask_filter
end string for masks to run on. Default: "_masks"
- --test_dir
folder containing test data (optional)
- --learning_rate
learning rate. Default: 0.2
- --n_epochs
number of epochs. Default: 500
- --batch_size
batch size. Default: 8
- --num_workers
number of dataloader workers. Default: 0
- --dataloader
Use pytorch dataloader instead of older manual loading code.
- --min_train_masks
minimum number of masks a training image must have to be used. Default: 1
- --residual_on
use residual connections
- --style_on
use style vector
- --concatenation
concatenate downsampled layers with upsampled layers (off by default which means they are added)
- --save_every
number of epochs to skip between saves. Default: 100
- --save_each
save the model under a different filename per --save_every epoch for later comparsion
- --RAdam
use RAdam instead of SGD
- --checkpoint
turn on checkpoints to reduce memory usage
- --dropout
Use dropout in training
- --tyx
list of yx, zyx, or tyx dimensions for training
- --links
Search and use link files for multi-label objects.
- --amp
Use Automatic Mixed Precision.
- --affinity_field
Use summed affinity instead of distance field.
hardware arguments#
- --use_gpu
use gpu if torch or mxnet with cuda installed
- --check_mkl
check if mkl working
- --mkldnn
for mxnet, force MXNET_SUBGRAPH_BACKEND = "MKLDNN"
development arguments#
- --verbose
flag to output extra information (e.g. diameter metrics) for debugging and fine-tuning parameters
- --testing
flag to suppress CLI user confirmation for saving output; for test scripts
- --timing
flag to output timing information for select modules