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.
*Noto: The raster is downloaded from mapbox according to the vector range, and model is SegFormer_B2.
- 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.
-
Download and install QGIS and clone the repo:
git clone git@github.com:deepbands/buildseg.git
-
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
-
-
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
.
- You can know this folder from QGIS Setting Menu at the top-left of QGIS UI
-
Open QGIS, load your raster and select the ONNX file (
*.onnx
) then clickok
.
- 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
.
This work is in progress, at present, the relevant documents are as follows :
- Build a sample plugin instead of use plugin builder.