Installation - orthoseg/orthoseg GitHub Wiki

Python package/environment manager

As the scripts are written in Python, a package manager is needed to install the packages the scripts depend on. The rest of the installation manual assumes you use conda. Using pip and ideally a virtual environment manager is possible as well, but some dependencies are a bit more difficult to install without using conda. More info + installers for miniforge can be found here.

Install orthoseg + dependent packages

The following commands will:

  • create a new environment
  • optional: make conda-forge the default channel: only needed if you use miniconda/anaconda. If you use miniforge, conda-forge is automatically the default channel.
  • install the dependencies that are available as conda packages
  • install orthoseg using pip, as orthoseg (and some other dependencies) are not available as a conda package
conda create --name orthoseg 
conda activate orthoseg
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install -y python=3.10 pip "cudatoolkit>=11.2,<11.3" cudnn gdown "geofileops>=0.6,<0.8" "geopandas>=0.12" numpy h5py owslib pillow pycron "pygeoops>=0.2,<0.3" pyproj rasterio "shapely>=2"
pip install orthoseg

Remarks

  1. In general it is strongly recommended when using conda to install everything from the same channel, eg. either defaults or conda-forge. Ending up with a mixture of packages from multiple channels for the dependencies of orthoseg can lead to import and/or runtime errors. See the conda-forge section on using multiple channels for more details.