Command Line Interface#

The Raster Vision command line utility, rastervision, is installed with a pip install of rastervision, which is installed by default in the Docker Images. It has a main command, with some top level options, and several subcommands.

> rastervision --help

 Usage: rastervision [OPTIONS] COMMAND [ARGS]...

 The main click command.

 Sets the profile, verbosity, and tmp_dir in RVConfig.

 -p, --profile TEXT  Sets the configuration profile name to use.
 -v, --verbose       Increment the verbosity level.
 --tmpdir TEXT       Root of temporary directories to use.
 --help              Show this message and exit.

 predict      Use a model bundle to predict on new images.
 run          Run sequence of commands within pipeline(s).
 run_command  Run an individual command within a pipeline.



Run is the main interface into running pipelines.

> rastervision run --help

Usage: rastervision run [OPTIONS] RUNNER CFG_MODULE [COMMANDS]...

Run COMMANDS within pipelines in CFG_MODULE using RUNNER.

RUNNER: name of the Runner to use

CFG_MODULE: the module with `get_configs` function that returns
PipelineConfigs. This can either be a Python module path or a local path
to a .py file.

COMMANDS: space separated sequence of commands to run within pipeline. The
order in which to run them is based on the Pipeline.commands attribute. If
this is omitted, all commands will be run.

-a, --arg            KEY VALUE   Arguments to pass to get_config function
-s, --splits         INTEGER     Number of processes to run in parallel for splittable
--pipeline-run-name  TEXT        The name for this run of the pipeline.
--help                           Show this message and exit.

Some specific parameters to call out:


Use -s N or --splits N, where N is the number of splits to create, to parallelize commands that can be split into parallelizable chunks. See Running Commands in Parallel for more information.


The run_command is used to run a specific command from a serialized PipelineConfig JSON file. This is likely only interesting to people writing custom runners.

> rastervision run_command --help

Usage: rastervision run_command [OPTIONS] CFG_JSON_URI COMMAND

Run a single COMMAND using a serialized PipelineConfig in CFG_JSON_URI.

--split-ind INTEGER   The process index of a split command
--num-splits INTEGER  The number of processes to use for running splittable
--runner TEXT         Name of runner to use
--help                Show this message and exit.


Use predict to make predictions on new imagery given a model bundle.

> rastervision predict --help

Usage: rastervision predict [OPTIONS] MODEL_BUNDLE IMAGE_URI LABEL_URI

Make predictions on the images at IMAGE_URI using MODEL_BUNDLE and store
the prediction output at LABEL_URI.

-a, --update-stats       Run an analysis on this individual image, as
                        opposed to using any analysis like statistics that
                        exist in the prediction package
--channel-order TEXT     List of indices comprising channel_order. Example:
                        2 1 0
--help                   Show this message and exit.