Product SAM2 2025

TerraLabel

An AI-powered geospatial labeling tool that transforms single clicks into accurate GeoJSON polygons using Meta's SAM2. Human-in-the-loop annotation at 5-10x the speed of manual digitization.

Platform

terralabel.ai

Try Demo
TerraLabel labeling interface showing AI-powered polygon selection on satellite imagery
SAM2 Powered

Platform Capabilities

5-10x

Faster Than Manual

<500ms

GPU Inference

50+

Undo/Redo Steps

Click

To Polygon

The Problem: Scaling Geospatial Annotation

Training ML models for remote sensing requires labeled data. Whether detecting solar panels, extracting building footprints, or mapping agricultural parcels, someone needs to trace those boundaries. Traditional approaches are either accurate but slow (manual) or fast but often wrong (fully automated).

Manual Digitization

Accurate but tedious. Hours spent tracing polygon boundaries pixel by pixel.

Fully Automated

Fast but unreliable. Models make mistakes that require manual correction anyway.

TerraLabel Approach

AI handles boundary tracing; humans handle judgment calls. Best of both worlds.

SAM2 Integration

TerraLabel leverages Meta's Segment Anything Model 2 (SAM2) with Hiera Large backbone. SAM2's image encoding is expensive, but subsequent prompts are cheap—perfect for interactive labeling workflows.

Click-to-Polygon

Single clicks are transformed into accurate polygons. The AI traces object boundaries automatically, understanding context from the surrounding imagery.

Point Prompts Multi-mask Output Confidence Scoring

Hiera Large Backbone

SAM2's hierarchical vision transformer provides multi-scale features critical for accurately segmenting objects at various sizes in satellite imagery.

224MB Model GPU Accelerated ONNX Runtime

Interactive Labeling Tools

Built on deck.gl's editable layers, TerraLabel provides professional GIS-quality drawing tools in the browser. Switch between modes depending on the annotation task.

AI-Assisted Selection

Single-click SAM2 segmentation that traces object boundaries automatically with 100-500ms latency.

Manual Drawing Tools

Point, Line, Polygon, Circle, and Drag Draw modes for precise manual annotation when needed.

Undo/Redo History

50-step history with full state preservation. Never lose work due to accidental edits.

Measurement Tools

Distance, Area, and Angle calculations with real-time feedback as you annotate.

Multiple Selection Modes

Rectangle and Polygon selection for bulk operations on multiple features.

Vector Tile Visualization

View thousands of labeled features across entire study areas using Martin tile server.

Three-Tier Architecture

TerraLabel connects a Svelte frontend with deck.gl mapping, a FastAPI backend running SAM2 inference, and PostgreSQL with PostGIS for spatial data storage.

Frontend

Svelte 5 with deck.gl editable layers. Handles all map interaction and polygon editing.

Svelte 5deck.glTurf.js

Backend

FastAPI with SAM2 inference. Simple REST API: send image and coords, receive polygon.

FastAPISAM2PyTorch

Database

PostgreSQL with PostGIS stores imagery and labeled features with spatial indexing.

PostgreSQLPostGISGIST Index

Tile Server

Martin serves vector tiles directly from PostGIS for efficient visualization.

MartinMVTTippecanoe

Vector Tile Visualization

View all labeled features across the entire study area. Individual tiles are ~50KB compared to loading the full dataset at 160MB+.

TerraLabel visualization showing labeled solar panels across Canberra

Technology Stack

Svelte 5
SvelteKit
deck.gl
Turf.js
FastAPI
SAM2
PostgreSQL
PostGIS
Martin
Docker
NVIDIA CUDA
ONNX

Key Learnings

Technical Insights

  • SAM2 generalizes well to satellite imagery despite natural image training
  • Sub-second latency is critical for maintaining labeling flow state
  • Douglas-Peucker polygon simplification is essential for usable output
  • Vector tiles transformed visualization from unusable to smooth

Production Results

  • Thousands of solar panels labeled using ACT aerial imagery
  • 5-10x faster than manual digitization with comparable accuracy
  • Human-in-the-loop workflow produces better results than either approach alone
  • GPU inference (100-500ms) vs CPU (2-5s) makes interactive use viable

Try the live demo

Click on satellite imagery to generate AI-powered polygons. Explore thousands of labeled solar panels across Canberra.