The provided Google Colab code is the result from the project SEERI, a collaboration between Braga Tech. and GIZ. The code will produce a vectorize building shape from deep learning process for building segmentation that will be fed to the SEERI website, which then be used for estimating solar potential on the rooftop.
To run the code several data have to be downloaded first. After setting-up the folder structures in google drive which will be done automatically using the provided code, label class, image, and shapefile data has to be uploaded to the following directories:
- label class directory: /content/drive/MyDrive/proj_name/
- image directory: /content/drive/MyDrive/proj_name/original_data/img/
- shapefile directory: /content/drive/MyDrive/original_data/shp/building_shp/
Label class file can be downloaded from this repository or from this link, and the sample data that was used in the project can be downloaded here.
Moreover, the prediction model resulted from the training will be stored in this directory:
/content/drive/MyDrive/proj_name/model/bss_model/
The prediction model that was used in the project can be downloaded here, which can then be uploaded to the directory mentioned above.
Here are the result of model training and image segmentation process.
The regularization on the predicted building shape was done using the repo from: https://github.com/zorzi-s/projectRegularization, the pretrained weights needed to run the code can be downloaded from the provided repo. The pretrained weights should be uploaded to the following directories:
/content/drive/MyDrive/proj_name/model/pretrained_weights_gan/
Note that as some error occured when using regularize.py from the provided repo on google colab, the code was slightly adjusted and the modified code can be downloaded here or from this repository.
The figure below shows the result of the building shape after regularization process.
Some of the original code that was used in the project are the following: