Prepare new project - orthoseg/orthoseg GitHub Wiki

A few technical steps need to be taken to prepare a new segmentation project.

1. Only once: prepare "projects" directory

If this is your very first orthoseg project, you need to prepare a directory where you want to put your orthoseg projects. In the rest of the documentation we'll refer to this directory as {projects_dir}.

It doesn't really matter where this directory is located, but these are examples that can give you some inspiration:

  • on linux: ~/orthoseg/projects
  • on windows: c:/users/{username}/orthoseg/projects

The easiest way to create it is by starting from a copy of the sample_projects directory to eg. your personal "orthoseg" directory and rename it to "projects". This way your projects directory immediately contains:

  • an imagelayers.ini file (with sample content)
  • a project_defaults_overrule.ini file (with sample content)
  • the "project_template" directory: the template for a new segmentation project

2. Add the layer(s) you want to segment on to the image layer configuration

The configuration for the image layers is located in {projects_dir}/imagelayers.ini. At the moment only WMS layers are supported.

The basic structure of this configuration file is as follows: every section in the .ini file (eg. [BEFL-2019]) contains the configuration of one "image layer". In later steps of this tutorial you well need to use the "image layer names" (for these examples BEFL-2019 and BEFL-2020), they are referred to with {image_layer_name}.

# In this file, the image layers we can use in segmentations are configured. 

[BEFL-2019]
# Configuration info of this layer
...

[BEFL-2020]
# Configuration info of this layer
...

A more elaborate example that can be used as a template for the configuration can be found here: imagelayers.ini.

3. Project name

Choose a new name for the segmentation project: par example 'greenhouses', 'trees', 'buildings',... In the rest of the manual the project name will be refered to with {segment_subject}.

4. Prepare "project" directory

For your new segmentation project, make a copy of the "project_template" directory to {projects_dir} and rename it to {segment_subject}.

5. Prepare project settings

Rename the project file in the new project directory from "projectfile.ini" to "{segment_subject}.ini". In the file you should at least change the following parameter:

[general]
segment_subject = {segment_subject}

As you might have recognized from the small section above, orthoseg uses the good old .ini file format for its configuration, with "ExtendedInterpolation". General information about this file format can be found here: ConfigParser-ExtendeInterpolation

The configuration can be found + modified in the following files:

  1. All existing sections and parameters + their default values can be found in the following file: orthoseg_install_dir/orthoseg/project_defaults.ini. It is highly recommended not to change anything in this file, as it will be overwritten when installing a new version of orthoseg anyway. But if you want to overrule any setting, this is the perfect spot to find all existing sections + parameters and copy/paste the section + parameter to one of the next files and change the value there to overrule it for your project(s).
  2. If you want to overrule a parameter for all the projects in your project directory, add the section + parameter to the project_defaults_overrule.ini file in your projects directory, eg: {projects_dir}/project_defaults_overrule.ini
  3. If you want to overrule parameters for a specific project, you can do so in the project-specific config file: eg. {projects_dir}/{segment_subject}/{segment_subject}.ini

6. Configure image layer(s)

If the image layers you want to train/predict on aren't configured yet, configure them in {projects_dir}/imagelayers.ini, the same way as the default layers provided.

7. Prepare training data files

The labels folder in the new project folder contains two .gpkg files where training examples can be added to as explained in the following page of this manual. The file names should have the following structure:

  • {segment_subject}_{image_layer_name}_locations.gpkg
  • {segment_subject}_{image_layer_name}_polygons.gpkg

If you want to create one segmentation with training examples based on multiple image layers, you can create a seperate pair of .gpkg files per image layer.

8. Add project to tasks.csv file

The tasks.csv file contains a list of the orthseg tasks you want to be able to run. Copy the tasks from the footballfields sample project and change the path to the projectsettings file. How to run tasks will be explained in Run train, predict,... session.

9. Prepare GIS project

Start your prefered GIS application (eg. QGIS), and create a new project. Add the .gpkg files from the labels directory and add the layers you want to digitize the training examples on (eg. BEFL-2019). It is practical to create a layer group per image layer you want to train data on with:

  • the 2 corresponding .gpkg files
  • the image layer (eg. BEFL-2019)

Save the project to the project directory.