Supported TasksBuilding Footprint Segmentation

Building Footprint Segmentation

Extract precise building outlines from satellite or aerial imagery

Default model (v1.0.6+): omitting modelId loads ChangeStar ViT-B (geobase/changestar-building-segmentation-vitb). Pass an explicit modelId for the lighter footprint weights.

Models

Hub idRoleNotes
geobase/changestar-building-segmentation-vitbDefaultDense ChangeStar ViT-B; 1024px tiles. Prefer dtype: "q8" (~135MB) or fp32 (~377MB).
geobase/building-footprint-segmentationOptionalSmaller / faster footprint model; use when you need the previous default behavior.

Unknown modelId values fail fast (no silent fallback).

Quick Start

import { geoai } from "geoai";
 
// Defaults to ChangeStar ViT-B
const pipeline = await geoai.pipeline(
  [{ task: "building-footprint-segmentation" }],
  providerParams
);
 
const result = await pipeline.inference({
  inputs: { polygon: myPolygon },
  mapSourceParams: { zoomLevel: 18 },
  postProcessingParams: {
    confidenceThreshold: 0.5,
  },
});
 
console.log(
  `Extracted ${result.detections.features.length} building footprints`
);

ChangeStar with quantized weights

const pipeline = await geoai.pipeline(
  [
    {
      task: "building-footprint-segmentation",
      modelId: "geobase/changestar-building-segmentation-vitb",
      modelParams: {
        dtype: "q8", // or "fp32"
        device: "webgpu", // try "wasm" if WebGPU fails for your browser/ORT build
      },
    },
  ],
  providerParams
);

Lighter footprint model

const pipeline = await geoai.pipeline(
  [
    {
      task: "building-footprint-segmentation",
      modelId: "geobase/building-footprint-segmentation",
    },
  ],
  providerParams
);
 
const result = await pipeline.inference({
  inputs: { polygon: myPolygon },
  postProcessingParams: {
    confidenceThreshold: 0.5,
    minArea: 20, // lighter model only
  },
});

Parameters

Post-Processing

postProcessingParams: {
  confidenceThreshold: 0.5, // 0.0–1.0 (both models)
  minArea: 20               // minimum area in pixels (lighter model)
}

Map Source

mapSourceParams: {
  zoomLevel: 18; // 17–20 recommended for building outlines
}

Output

Returns GeoJSON with precise building boundary polygons:

{
  detections: {
    type: "FeatureCollection",
    features: [
      {
        geometry: { /* precise building polygon */ },
        properties: {}
      }
    ]
  },
  geoRawImage: GeoRawImage
}