Pre-encoded Mode#

The Pre-encoded Mode uses pre-encoded image features generated by the Geo-SAM Image Encoder tool. This is ideal when:

  • You segment the same image repeatedly across multiple sessions.

  • You encode on a remote server (Colab, AWS) and segment locally.

  • You want the fastest possible prompt response (no background encoding delay).

Switching to Pre-encoded Mode#

  1. Open the Geo-SAM Segmentation tool.

  2. In the Input / Output tab, change the source selector dropdown from Live Encoding to Pre-encoded.

  3. The input controls switch to show a file picker and a Load button.

Loading a Feature Folder#

  1. Click the file picker next to Pre-encoded and select the folder that contains the encoded features (the output directory from the Image Encoder, which contains a features/ subfolder and a manifest.parquet).

  2. Click Load.

Feature folder structure

A valid feature folder looks like this:

my_feature_folder/
├── manifest.parquet       # chip metadata (bounds, CRS, model info)
└── features/
    ├── chip_000000.pt     # encoded feature for chip 0
    ├── chip_000001.pt     # encoded feature for chip 1
    └── ...

After loading, Geo-SAM displays a success message with the chip count and model information. The model dropdown is locked to the model that was used during encoding (recorded in the manifest).

Model must be downloaded

The model used during encoding must be downloaded in Settings > Model Management. If it is missing, Geo-SAM will prompt you to download it.

Adding the Raster Image#

Feature files contain encoded features but not the image itself. Add the corresponding raster image to your QGIS project so you can see what you are segmenting. The image must cover the same area as the encoded features.

Zoom to Extent#

Click Zoom to to navigate the map canvas to the feature folder’s extent. This is useful when the feature folder covers a different area than your current view.

Segmentation Workflow#

Once the feature folder is loaded, the segmentation workflow is identical to the Live Encoding mode:

  1. Add foreground points, background points, and bounding boxes in the Prompts tab.

  2. View results instantly (no background encoding – features are already available).

  3. Save with S or the Save button.

  4. Clear with C and move to the next object.

See Live Encoding Mode for the full reference on prompts, styles, options, shortcuts, and preview mode – they are shared between both modes.

Generating Feature Files#

Feature files are created by the Geo-SAM Image Encoder tool. See Geo-SAM Image Encoder for the full encoder reference, or Encoder Copilot for the interactive parameter tuning tool.