Setting Up the GeoAI QGIS Plugin
Introduction¶
Learning Objectives¶
Plugin Architecture Overview¶
Installing the QGIS Plugin¶
Prerequisites¶
Option A: QGIS Plugin Manager (Recommended)¶
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¶
Option A: Built-in Dependency Installer (Recommended)¶
# 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
Creating the Python Environment¶
Installing the Environment¶
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¶
Setting Up SAM 3 Access¶
Requesting Access on Hugging Face¶
Authenticating and Downloading the Model¶
pixi run hf download facebook/sam3
GPU Memory Management¶
When to Clear GPU Memory¶
Monitoring GPU Usage¶
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¶