AI Segmentation in QGIS
Get started in minutes. Point at objects, get precise vectors.
1Installation
2. Download Plugin
Open QGIS, go to Plugins → Manage and Install Plugins, search for "AI Segmentation" and click Install
Download Plugin2First Launch
Install the dependencies, get your verification code by writing your mail, download the AI segmentation model - everything is installed automatically, no manual setup, no need to restart QGIS.
Auto-install of dependencies
It creates an isolated python virtual environment and installs:
- • PyTorch
- • Segment Anything
- • Rasterio, Pandas, NumPy
Auto-install AI Segmentation Model
It Downloads Meta's Segment Anything Model (ViT-B):
- • Model size: 375 MB
- • Cached locally for offline use
Installation Paths
Here's where the plugin stores its files on your system:
AI Model for Segmentation
C:\Users\<username>\.qgis_ai_segmentation\checkpoints\Cached Encoding of your raster (for faster AI processing)
C:\Users\<username>\.qgis_ai_segmentation\features\Python Dependencies
%APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\AI_Segmentation\src\venv_py3.*\3Simple Mode
Default Mode
One object at a time
Segment one element per export: a single building, car, tree, or any object you click on.
Output
One layer per object
Each export creates a new layer: RasterName_mask_1, RasterName_mask_2, etc.
Select Your Raster
Choose a GeoTIFF layer from the dropdown. The plugin will encode it into tiles. This happens once and is cached.
Click on ONE Object
Left-click to include an area, right-click to exclude. Focus on a single element: one building, one car, one tree.
Refine (Optional)
Use Expand/Contract to adjust boundaries. Use Simplify to reduce polygon complexity.
Export to Layer
Click 'Export to layer' to save as GeoPackage (.gpkg). The session resets so you can segment another object.
4Batch Mode
Advanced Mode
Multiple objects, one layer
Save multiple masks, then export them all together into a single layer.
Use Case
Collect similar objects
Perfect for: all buildings in an area, all cars in a parking lot, all trees in a forest patch.
Enable Batch Mode
Click the 'Batch Mode' button
Segment First Object
Click on an object to segment it. Left-click to include, right-click to exclude areas.
Save Mask
Click 'Save mask' to add this segmentation to your collection. The counter shows how many you've saved.
Repeat for Each Object
Segment another object, click 'Save mask' again. Repeat until you've collected all the objects you need.
Export All
Click 'Export to layer' to save all collected masks as a single GeoPackage with multiple features.
5Refine Panel
Fine-tune your segmentation results before exporting. Click the "Refine mask" panel to expand it.
Expand / Contract
Dilate or erode the mask boundaries. Positive values expand outward, negative values shrink inward. Range: -30 to +30 pixels.
Simplify Outline
Reduce polygon complexity using Douglas-Peucker algorithm. Higher values = smoother but less precise edges. Default: 2.
Fill Holes
Fill interior holes completely surrounded by the selection. Useful for buildings with courtyards or objects with gaps.
Min. Region Size
Remove small disconnected artifacts below this area threshold (in pixels²). Example: 200 = ~14x14 pixel regions. Range: 0-10000.
6Shortcuts
Keyboard Shortcuts
| Key | Action |
|---|---|
G | Start segmentation |
Left Click | Add positive point (include) |
Right Click | Add negative point (exclude) |
Ctrl+Z (Cmd+Z on Mac) | Undo last point |
S | Save mask (Batch mode only) |
Enter | Export to layer |
Escape | Clear current mask |
7Support the Project
Want to give some love?
A rating on the QGIS Plugin Marketplace would be a banger for sure
Found a bug, want more features?
We are on a spicy quest to make the best AI tools in QGIS, pleaseee help us (: