Quick Start (5 Minutes)#
This guide walks you through segmenting landforms using the Live Encoding workflow – the fastest way to get started with Geo-SAM.
Prerequisites#
QGIS 3.x/4.x installed.
Geo-SAM plugin installed and activated (see Installation).
Dependencies installed via Settings > Dependencies > Install Missing.
A SAM model downloaded via Settings > Model Management (e.g., SAM2.1 Base).
A raster image loaded in your QGIS project.
Step 1: Open the Segmentation Tool#
Click the Geo-SAM Segmentation icon in the toolbar. A dock widget appears at the top of the QGIS window with a split-panel layout:
Left side: Input / Output and Prompts tabs
Right side: Styles and Options tabs
Step 2: Select the Live Encoding Mode#
In the Input / Output tab, ensure the source selector dropdown shows Live Encoding (this is the default). Then:
Select a SAM model from the Model dropdown (e.g., SAM2.1 Base).
Select your raster layer from the Layer dropdown.
Under Segmentation Result, select an existing polygon layer or click Load/Create to specify a new Shapefile.
Tip
If you have not downloaded the selected model, Geo-SAM will prompt you to open Model Management and download it.
Step 3: Draw a Bounding Box#
Go to the Prompts tab.
Click the BBox button to activate the bounding-box tool.
Drag a rectangle around the landform you want to segment. As you drag, the preview shows the landform inside the box segmented in real-time with well-defined boundaries.
The first drag triggers background encoding of the visible image area. A progress bar appears in the QGIS task manager. Once encoding completes, the segmentation result appears instantly.
First prompt takes longer
The first prompt on a new area requires encoding the image features (a few seconds to minutes depending on image size and hardware). Subsequent prompts in the same area load from cache at millisecond speed.
Step 4: Refine with More Prompts#
Add a background point: Click BG, then click on an area you want to exclude from the segmentation.
Add a foreground point: Click FG, then click on an area you want to include in the segmentation.
Undo the last prompt: Press Z or click Undo.
Clear all prompts: Press C or click Clear.
You can combine multiple prompts to fine-tune the segmentation of a single object.
Step 5: Save the Result#
When you are satisfied with the segmentation, press S or click Save to save the current segmentation polygon.
Step 6: Move to the Next Object#
Press C to clear prompts, then repeat Steps 3-5 for the next object.
Remember
SAM segments one object at a time. Always save your results before clearing prompts and moving to the next object.
What’s Next?#
Live Encoding Mode – full reference for Live Encoding mode
Pre-encoded Mode – Pre-encoded mode
Geo-SAM Image Encoder – how to pre-encode images with the Image Encoder
Settings – configure cache, performance, and models