Skip to content

Segmentation of urban aerial point clouds with Deep Learning in Pytorch.

Notifications You must be signed in to change notification settings

theobdt/aerial_pc_classification

Repository files navigation

Aerial point cloud classification

This repository is our project for the course Point Cloud for 3D Modeling (NPM3D) of the IASD master program. This implementation is strongly inspired from the paper classification of aerial point clouds with deep learning by Emre Özdemir and Fabio Remondino.

Our project report is available at the following link : https://www.overleaf.com/read/tdjgnxjbcmpg

Installation

This project requires python >= 3.5

$ git clone https://github.com/theobdt/aerial_pc_classification.git
$ cd aerial_pc_classification
$ pip3 install -r requirements.txt

Getting the data

To get the data, you will first have to request access on the ISPRS website, it is totally free. Fill out the questionnaire to receive the credentials. Then download data using the following script :

$ chmod +x fetch_data.sh
$ ./fetch_data.sh

1. Preprocessing

Convert files to PLY and center/scale the point clouds.

$ python3 preprocessing.py -f data/vaihingen3D_train.pts data/vaihingen3D_test.pts --centering

Output files will be saved to data/preprocessed/.

intensity trainVaihingen training intensity

2. Computing features

Parameters used for features extraction are stored in cfg/config_features_extraction.yaml. Output files will be saved in data/features/.

Available steps are :

  1. Local descriptors (descriptors). A few examples : normals trainNormal angles to vertical axis sphericity trainSphericity planarity trainPlanarity
  2. Region growing (region_growing) regions trainResults of region growing
  3. Ground extraction (ground_extraction) ground trainGround extraction
  4. Ground rasterization (ground_rasterization) ground raterized_trainGround rasterized
  5. Height above ground (height_above_ground) height_trainHeight above ground

To run all steps at once:

$ python3 compute_features.py --full_pipeline --files data/preprocessed/vaihingen3D_train.ply data/preprocessed/vaihingen3D_test.ply 

To run all steps starting from a specific one :

$ python3 compute_features.py --from_step region_growing --files data/preprocessed/vaihingen3D_train.ply data/preprocessed/vaihingen3D_test.ply

To run steps individually :

$ python3 compute_features.py --steps region_growing ground_extraction --files data/preprocessed/vaihingen3D_train.ply data/preprocessed/vaihingen3D_test.ply

3. Training Bi LSTM network

Configuration file for training is stored in cfg/config_bilstm.yaml. To train the network, run the following command :

$ python3 train.py

A new checkpoint will be created in ckpts/[current timestamp], along with a plot of accuracies and losses throughout training.

4. Predict with Bi LSTM network

To compute predictions on all points of the cloud run :

$ python3 test.py -f data/features/vaihingen3D_test.ply --ckpt ckpts/2020-04-10_12-25-36

A new folder will be created at data/predictions/[model timestamp], along with a comprehensive metrics table. labels_test9-classes test set predictions_test9-classes predictions on test set

confusion_matrixConfusion matrix and metrics