Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 4.91 KB

README.md

File metadata and controls

81 lines (53 loc) · 4.91 KB

buildseg: QGIS plugin for building extraction

English | 简体中文

Python 3.8 QGIS 3.16.11 license release

buildseg is a Building Extraction plugin for QGIS based on ONNX (Use PaddlePaddle to train and convert to ONNX), and it using the semantic segmentation ability provided by paddleseg, large areas can be extracted and spliced. At present, automatic downloading of raster images and building extraction are added, and users need to register in mapbox and record Token.

show

*Noto: The raster is downloaded from mapbox according to the vector range, and model is SegFormer_B2.

News

  • xx Apr 2022 [v0.3] : 1. Add support for online map tiles based on Mapbpx; 2. Internationalization support.
  • 08 Feb 2022 [v0.2] : 1. ONNX is used instead of PaddlePaddle; 2. Test in Windows / Linux / Mac OS.
  • 23 Dec 2021 [v0.1] : 1. Add segmentation based on PaddlePaddle; 2. Add mask to shapefile; 3. Add simplify.

How to use

  1. Download and install QGIS and clone the repo:

    git clone [email protected]:deepbands/buildseg.git
    
  2. Install requirements:

    • Enter the folder and install dependent libraries using OSGeo4W shell (Open As Administrator) :

      cd buildseg
      pip install -r requirements.txt
    • Or open OSGeo4W shell as administrator and enter:

      pip install opencv-python onnx onnxruntime --user
  3. Copy folder named buildseg in QGIS configuration folder and choose the plugin from plugin manager in QGIS (If not appeared restart QGIS).

    • You can know this folder from QGIS Setting Menu at the top-left of QGIS UI [Settings] > [User Profiles] > [Open Active Profile Folder].
    • Go to python\plugins then paste the buildseg folder.
    • Full path should be like : C:\Users\$USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\buildseg.
  4. Open QGIS, load your raster and select the ONNX file (*.onnx) then click ok.

Model and Parameter

  • mIoU from PaddlePaddle and other from ONNX.
  • Train / Eval (5k) Dataset: AI Studio.
  • Run time test environment: [Win10] / [i7-10750H] / [RTX 2060] and test image: Baidu drive | Google drive.
Model Backbone Resolution mIoU Params(MB) Running Time(s) Static Weight
OCRNet HRNet_W18 512x512 89.38% 46.49 39.090 Baidu drive | Google drive
SegFormer_B2 - 512x512 89.47% 104.56 59.498 Baidu drive | Google drive
BiSeNet_V2 - 512x512 84.61% 8.94 7.004 Baidu drive | Google drive

*Noto : All of Baidu drive's code is band.

How to Train

This work is in progress, at present, the relevant documents are as follows :

TODO:

  • Build a sample plugin instead of use plugin builder.