Run sample project - orthoseg/orthoseg GitHub Wiki

Once the installation is completed, you can run the sample project included. The project is an easy way to get started and should give a good idea on how you can start your own segmentation project.

It contains:

  • a training dataset that can be used to train a network to detect football fields
  • a sample of the basic configuration for a typical project
  • a sample of the default directory structure used by orthoseg
  • a QGIS project file with the training data + aerial images that will be used to train the neural network + to detect football fields on

Remark: the training data included is meant to show how the process works, not to give perfect results.

Running the sample project is easy. If the orthoseg installation was successful, the following steps should do the trick:

  1. start a conda command prompt

  2. activate the orthoseg environment with

    conda activate orthoseg

  3. download the sample projects from orthoseg. You can specify the base location to download the sample projects to, but in this tutorial I'll assume "~" (= your home directory) for simplicity.

    orthoseg_load_sampleprojects ~

  4. preload the images so they are ready to detect the football fields on, using the sample configurations file "footballfields.ini_BEFL-2019".

    orthoseg_load_images --config ~/orthoseg/sample_projects/footballfields/footballfields_BEFL-2019.ini

  5. for the footballfields sample project, a pretrained neural network was downloaded in step orthoseg_load_sampleprojects to avoid having to train it. But, normally you would now train the neural network with the following command.

    orthoseg_train --config ~/orthoseg/sample_projects/footballfields/footballfields_BEFL-2019.ini

  6. detect the football fields.

    orthoseg_predict --config ~/orthoseg/sample_projects/footballfields/footballfields_BEFL-2019.ini

Now, the directory ~/orthoseg/sample_projects/footballfields/output_vector will contain a .gpkg file with the football fields found.

An interesting exercise might be to detect football fields on another layer (on another location). To get reasonable results, this should be a layer with 0.25 meter pixel size, as this was the pixel size the footballfields detection was trained on. It's best to first read Prepare-new-project for some background information and then you could try the following steps:

  1. add the layer you want to predict on to the imagelayer.ini config file
  2. make a copy of footballfields_BEFL-2019.ini and change the "predict image_layer" parameter in the file to point to the new layer
[predict]
image_layer = BEFL-2019
  1. run orthoseg_load_images to prepare the layer to predict on

    orthoseg_load_images --config ~/orthoseg/sample_projects/footballfields/footballfields_BEFL-2019.ini

  2. run the detection again.

    orthoseg_predict --config ~/orthoseg/sample_projects/footballfields/footballfields_BEFL-2019.ini