autoemx.utils.install_segmentation module

Install the optional particle segmentation models in the current Python environment.

python -m autoemx.utils.install_segmentation sam2 [–dry-run] python -m autoemx.utils.install_segmentation micro-sam [–dry-run]

pip then warns that micro-sam requires PyQt6, segment-anything-py and trackastra: ignore it (left out on purpose).

sam2: SAM2 through Hugging Face transformers, the segmentation extra of AutoEMX (torch, torchvision, transformers; Apache-2.0 / BSD).

micro-sam: micro-sam (MIT; its model weights are CC-BY-4.0, downloaded from BioImage.IO on first use) is installed without its declared dependencies, which include PyQt6 (GPL) for its napari plugin, not needed to segment images, and segment-anything-py, a third-party repackaging of Meta’s segment_anything (installed instead from Meta’s repository, Apache-2.0). Its other dependencies are then installed (MICRO_SAM_REQUIREMENTS).

Created on Sat Oct 17 2026 @author: Andrea

autoemx.utils.install_segmentation.MICRO_SAM_REQUIREMENTS = ['torch>=2.5', 'torchvision', 'torch-em>=0.9', 'python-elf>=0.9', 'bioimage-cpp>=0.3', 'bioimageio.core>=0.11', 'napari>=0.7.1,<0.10', 'h5py', 'imagecodecs', 'imageio', 'joblib', 'kornia', 'natsort', 'networkx', 'pooch', 'timm', 'tqdm', 'xarray', 'xxhash', 'zarr']

its declared ones without PyQt6, segment-anything-py, and trackastra (tracking only); magicgui and superqt (MIT/BSD) come with napari, without any Qt binding

Type:

Dependencies of micro-sam used to segment images

autoemx.utils.install_segmentation.EXCLUDED = ('PyQt6', 'PyQt5')

Packages that must not be installed (GPL)

autoemx.utils.install_segmentation.install_commands(model: str) → List[List[str]][source]

The pip commands installing a model.

autoemx.utils.install_segmentation.gpl_packages_installed() → List[str][source]

Installed packages among those that must not be (EXCLUDED).

autoemx.utils.install_segmentation.main(argv=None) → int[source]