Documentation

AI Segmentation in QGIS

Get started in minutes. Point at objects, get precise vectors.

1Installation

1. Get QGIS

Make sure you have QGIS 3.x installed on your machine.

Download QGIS

2. Download Plugin

Open QGIS, go to Plugins → Manage and Install Plugins, search for "AI Segmentation" and click Install

Download Plugin

2First 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.

1

Select Your Raster

Choose a GeoTIFF layer from the dropdown. The plugin will encode it into tiles. This happens once and is cached.

2

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.

3

Refine (Optional)

Use Expand/Contract to adjust boundaries. Use Simplify to reduce polygon complexity.

4

Export to Layer

Click 'Export to layer' to save as GeoPackage (.gpkg). The session resets so you can segment another object.

Why one object at a time? The SAM model works best when focusing on a single element. For multiple objects in one layer, use Batch Mode below.

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.

1

Enable Batch Mode

Click the 'Batch Mode' button

2

Segment First Object

Click on an object to segment it. Left-click to include, right-click to exclude areas.

3

Save Mask

Click 'Save mask' to add this segmentation to your collection. The counter shows how many you've saved.

4

Repeat for Each Object

Segment another object, click 'Save mask' again. Repeat until you've collected all the objects you need.

5

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

KeyAction
GStart segmentation
Left ClickAdd positive point (include)
Right ClickAdd negative point (exclude)
Ctrl+Z (Cmd+Z on Mac)Undo last point
SSave mask (Batch mode only)
EnterExport to layer
EscapeClear 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 (: