Skip to content

Latest commit

 

History

2,151 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detection and Segmentation of Tree Instances on a Rwandan Satellite Dataset

Introduction

Rwanda-Instance provides the code for the Bachelor Thesis Detection and Segmentation of Tree Instances on a Rwandan Satellite Dataset. It uses MMDetection 2.25.0, an open source object detection toolbox based on PyTorch.

The code that was added in the course of this thesis can be found in the folder TreeSegmentation-Rwanda. The directory MMDetection contains the MMDetection model library, parts of its code were modified to better work with the project. Additionally, the folder cocoapi is a modified version (e.g., an increased number of detections for AP calculation) of https://github.com/cocodataset/cocoapi.

Installation

Step 1: Install PyTorch 1.10 with the PyTorch CUDA version matching the compiling CUDA version. E.g., for CUDA 11.1:

pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html

Step 2: Install MMCV using MIM (it might be necessary to restart the shell after installing openmim, so that the mim command is recognized).

pip install -U openmim
mim install mmcv-full==1.5.0

Step 3: Clone repository and install MMDetection.

git clone https://github.com/sbackmann/rwanda-segmentation
cd rwanda-segmentation
pip install -v -e MMDetection
pip install cocoapi/PythonAPI

Getting Started

After finishing the installation steps, the satellite images and the annotations should be pasted into the respective folders (TreeSegmentation-Rwanda/data/Training_Images_RGB for the images and TreeSegmentation-Rwanda/data/Training_tree_polygons for the annotation files including the .shp file).

Within the TreeSegmentation-Rwanda folder, two notebooks are available. Training.ipynb enables to reproduce the training that led to the models evaluated in the thesis. Testing.ipynb lets the user inference with the trained model weights from the thesis (or using their own) and also provides the means to evaluate the model metrics for veryfing the AP results.

All the experiments are located in the directory TreeSegmentation-Rwanda/experiments and are named following the pattern {Model}{Backbone}_{ConfigurationChanges}. For the configuration changes, see the tables specifying the change keys in the thesis. The model weights are released here and will be downloaded automatically if the respective experiment is selected.

License

MMDetection is released under the Apache 2.0 license. To comply with MMDetection's Apache 2.0 License, all those files of MMDetection that were modified contain a comment, stating that they were changed. The thesis itself is released under the CC BY-SA 4.0 license.

About

An instance segmenation approach on a Rwandan Tree dataset based on OpenMMLab's MMDetection

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages