Installation for devs - orthoseg/orthoseg GitHub Wiki

This page is still under construction... if you want more info, contact me ;-)...

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.

Fork orthoseg

Fork orthoseg and clone your personal fork. The location you clone to will be referred to as <orthoseg_path> further on.

Install dependent packages

Once you have conda installed, you can open a conda terminal window and create a new environment with the needed dependencies.

The following commands will create a new environment and install the needed dependencies. If you are using miniconda or anaconda (not miniforge or mambaforge) read the remark below first.

conda create --name orthosegdev 
conda activate orthosegdev
conda install -y python=3.10 geofileops owslib pillow pycron pyproj rasterio "cudatoolkit>=11.2,<11.3" cudnn h5py numpy
conda install -y flake8 black pytest pytest-order

# For the following packages, no conda package is available or -for tensorflow- no recent version.
pip install "tensorflow>=2.5,<2.9" "segmentation-models>=1.0,<1.1"

Remark

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 can lead to all sorts of problems. Some dependencies needed for orthoseg are only available on conda-forge, so for the rest of the manual it is expected that this channel is used. If you are using conda via the installation of miniforge or mambaforge this is already OK. If you are using miniconda or anaconda you need to run the following commands after creating and activating the orthoseg(dev) environment:

conda config --env --add channels conda-forge
conda config --env --set channel_priority strict