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.
*Noto: Raster's size is 4983x3475, and model is SegFormer_B2.
- 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 :
- Add online map tiles support :
- Extract building on raster in memory.
- Add vector range selection.