Before installing segger, please install GPU-accelerated versions of PyTorch, RAPIDS, and related packages compatible with your system. Please ensure all CUDA-enabled packages are compiled for the same CUDA version.
- PyTorch & torchvision: Installation guide
- torch_scatter: Installation guide
- RAPIDS (cuDF, cuML, cuGraph): Installation guide
- CuPy: Installation guide
- cuSpatial: Installation guide
For example, on Linux with CUDA 12.1 and PyTorch 2.5.0:
# Install PyTorch and torchvision for CUDA 12.1
pip install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu121
# Install torch_scatter for CUDA 12.1
pip install torch_scatter -f https://data.pyg.org/whl/torch-2.5.0+cu121.html
# Install RAPIDS packages for CUDA 12.x
pip install --extra-index-url=https://pypi.nvidia.com cuspatial-cu12 cudf-cu12 cuml-cu12 cugraph-cu12
# Install CuPy for CUDA 12.x
pip install cupy-cuda12xDecember 2025: To stay up-to-date with new developments, we recommend installing the latest version directly from GitHub:
# Clone segger repo and install locally
git clone https://github.com/dpeerlab/segger.git segger && cd segger
pip install -e .Show top-level CLI help:
segger --helpTrain + predict in one run (end-to-end segmentation).
segger segment -i /path/to/input_data -o /path/to/run_outputRun prediction-only from a saved checkpoint.
segger predict \
-c /path/to/checkpoint.ckpt \
-i /path/to/input_data \
-o /path/to/predict_outputConvert segmentation outputs to downstream formats (xenium_explorer, merged, anndata, spatialdata).
segger export \
-s /path/to/segger_segmentation.parquet \
-i /path/to/source_data \
-o /path/to/export_output \
--format xenium_explorerCompute lightweight quality metrics from Segger outputs.
segger validate \
-s /path/to/segger_segmentation.parquet \
-i /path/to/source_data \
-o /path/to/validation_metrics.tsvRun selected metrics only:
segger validate \
-s /path/to/segger_segmentation.parquet \
-i /path/to/source_data \
--assigned --border-contamination --vsiPlot training curves from metrics.csv in an output directory.
segger plot -o /path/to/run_outputQuick terminal plot (no image written):
segger plot -o /path/to/run_output --quickReference management subcommands for CellxGENE Census:
segger atlas fetch colon
segger atlas preview colon
segger atlas list
segger atlas clear --tissue colonUse mode-specific help for the full parameter list:
segger segment --help
segger predict --help
segger export --help
segger validate --help
segger plot --help
segger atlas --helpInstall optional dependencies as needed:
pip install "segger[plot]" # for plotting support
pip install "segger[spatialdata]" # for SpatialData input/output
pip install "segger[census]" # for atlas reference fetching