Skip to the content.

Command line interface documentation

Training

yapic train <network> <image_path> <label_path> [options]

Prediction

yapic predict <network> <image_path> <output_path> [options]

Deployment: Export to DeepImageJ

yapic deploy <network> <image_path> <output_path> [options]

Parameters

network

Either a model file in h5 format to use a pretrained model or specific string to initialize a new model.

image_path

Path to image files. You can use wildcards, e.g. my_data/*.tif. In deploy mode, define one specific tif image file as example image.

Input image format

YAPic supports tif and tiff files

Especially in case of multidimensional images: Make sure to always convert your pixel images with Fiji before using YAPiC. Large amounts of image data can be conveniently converted with Fiji by using batch processing.

train and predict mode

Define a folder with tiff or tif images

path/to/my/images

or a wildcard

"path/to/my/images/*.tif"

Don’t forget double quotes in case of wildcards!

deploy mode

path/to/a/single/example_image.tif

The example image is packed into the DeepImageJ bundled model. If you share your model with others, they can easily apply the model within DeepImageJ on this test image.

label_path

Define a path to an Ilastik Project File (.ilp)

path/to/my/ilastik_project.ilp

or to label masks in tif format.

path/to/my/labelfiles/
"path/to/my/labelsfiles/*.tif"
Ilastik Project Files

The images in associated with your Ilastik project have to be identical with the tif images you define in the image_path argument.

Label masks in tif format

Optional parameters

-n –normalize=NORM

Set pixel normalization scope [default: local]

–cpu

Train using the CPU (not recommended, very slow).

–gpu=VISIBLE_DEVICES

If you want to use specific GPUs. To use gpu 0, set --gpu=0. To use gpus 2 and 3, set --gpu=2,3.

-h –help

Show documentation.

–version

Show version.

Train options

-e –epochs=MAX_EPOCHS

Maximum number of epochs to train [default: 5000].

-a –augment=AUGMENT

Set augmentation method for training [default: flip].

-v –valfraction=VAL

Fraction of images to be used for validation [default: 0.2] between 0 and 1.

-f –file=CLASSIFER

Path to trained model [default: model.h5].

–steps=STEPS

Steps per epoch [default: 50].

–equalize

Equalize label weights to promote influcence of less frequent labels.

–csvfile=LOSSDATA

Path to csv file for training loss data [default: loss.csv].

Deploy options

-s –size=Modelsize

Size of the network to be exported.

Large networks are applied faster in DeepImageJ, but consume more RAM. There are three options:

–skip-predict

Skip computation of prediction image. By default, the model is applied to the example image and the resulting probability map is packed into the DeepImageJ Bundled model. You can skip this to make deployment process faster.

Metadata

There are several optional parameters to add metadata to the model (e.g. author information). This is of particular interest if you would like to publish the model on the model repository.