Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Setting Up the GeoAI QGIS Plugin

Introduction

Learning Objectives

Plugin Architecture Overview

Installing the QGIS Plugin

Prerequisites

Option B: Helper Script

git clone https://github.com/opengeos/geoai.git
cd geoai/qgis_plugin
python install.py
python install.py --remove

Option C: Manual Installation

Enabling the Plugin

Setting Up Dependencies

# Linux/macOS
export GEOAI_CACHE_DIR=/path/to/writable/directory

# Windows (Command Prompt)
set GEOAI_CACHE_DIR=D:\geoai_cache

# Windows (PowerShell)
$env:GEOAI_CACHE_DIR = "D:\geoai_cache"

Option B: Pixi Environment (Advanced)

Installing Pixi

curl -fsSL https://pixi.sh/install.sh | sh
pixi --version

Creating the Python Environment

pixi init geo
cd geo

Installing the Environment

pixi install

Verifying PyTorch and CUDA

pixi run python -c "import torch; print('PyTorch:', torch.__version__); print('CUDA available:', torch.cuda.is_available()); print('GPU:', (torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'None'))"

Installing DeepForest

pixi run pip install deepforest
pixi run pip install -U numpy transformers

Launching QGIS from Pixi

pixi run qgis

Setting Up SAM 3 Access

Requesting Access on Hugging Face

Authenticating and Downloading the Model

pixi run hf auth login
pixi run hf download facebook/sam3

GPU Memory Management

When to Clear GPU Memory

Monitoring GPU Usage

nvidia-smi
watch -n 1 nvidia-smi

Checking for Plugin Updates

Key Takeaways

Exercises

Exercise 1: Install and Verify the Plugin

Exercise 2: Built-in Dependency Installer and Environment Verification

Exercise 3: GPU Memory Management and Plugin Maintenance