Installation

Supported OS

Currently, ivadomed supports GPU/CPU on Linux and Windows, and CPU only on macOS and Windows Subsystem for Linux.

Step 1: Setup dedicated python environment

You can setup ivadomed using either Conda or Venv:

  1. Setup Python Venv Virtual Environment.

    ivadomed requires Python >= 3.6 and <3.10.

    First, make sure that a compatible version of Python 3 is installed on your system by running:

    python3 --version
    

    If your system’s Python is not 3.6, 3.7, 3.8, or 3.9 (or if you don’t have Python 3 installed at all), please install Python before continuing.

    Once you have a supported version of Python installed, run the following command:

    # Replacing ``3.X`` with the Python version number that you installed):
    python3.X -m venv ivadomed_env
    

    Note

    If you use Debian or Ubuntu, you may be prompted to install the python3-venv module when creating the virtual environment. This is expected, so please follow the instructions provided by Python. For other operating systems, venv will be installed by default.

  2. Activate the new virtual environment (default named ivadomed_env)

    source ivadomed_env/bin/activate
    

Step 2: Install ivadomed

Install ivadomed and its requirements from PyPI:

pip install --upgrade pip

pip install ivadomed

Step 3: Install torch and torchvision with CPU or GPU Support

If you plan to run ivadomed on CPU only, install PyTorch per instructions provided below for your specific operating system:

pip install torch==1.8.0+cpu torchvision==0.9.0+cpu --find-links https://download.pytorch.org/whl/torch_stable.html

Developer-only Installation Steps

The additional steps below are only necessary for contributors to the ivadomed project.

The pre-commit package is used to enforce a size limit on committed files. The requirements_dev.txt also contain additional dependencies related to documentation building and testing.

After you’ve installed ivadomed, install the pre-commit hooks by running:

pip install -r requirements_dev.txt
pre-commit install