File size: 3,480 Bytes
e8a739b a291ab4 e8a739b a291ab4 e8a739b a291ab4 e8a739b a291ab4 e8a739b b85e90b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
---
tags:
- geospatial
- geobase
- building-footprint-segmentation
- building-detection
---
| <img src="https://upload.wikimedia.org/wikipedia/commons/6/6a/JavaScript-logo.png" width="28" height="28"> | [GeoAi](https://www.npmjs.com/package/geoai) |
|---|---|
> `task = building-footprint-segmentation`
### 🛠 Model Purpose
This model is part of the **[GeoAi](https://github.com/decision-labs/geoai.js)** javascript library.
**GeoAi** enables geospatial AI inference **directly in the browser or Node.js** without requiring a heavy backend.
**GeoAi** pipeline accepts **geospatial polygons** as input (in GeoJSON format) and outputs results as a **GeoJSON FeatureCollection**, ready for use with libraries like **Leaflet** and **Mapbox GL**.
<video controls autoplay loop width="1024" height="720" src="https://geobase-docs.s3.amazonaws.com/geobase-ai-assets/building-footprint-segmentation.mp4"></video>
---
### 🚀 Demo
Explore the model in action with the interactive [Demo](https://docs.geobase.app/geoai-live/tasks/building-footprint-segmentation).
### 📦 Model Information
- **Architecture**: U-Net–style Convolutional Neural Network (CNN)
- **Source Model**: [gunayk3/building_footprint_segmentation](https://huggingface.co/spaces/gunayk3/building_footprint_segmentation)
- **Quantization**: Yes
---
### 💡 Example Usage
```javascript
import { geoai } from "geoai";
// Example polygon (GeoJSON)
const polygon = {
type: "Feature",
properties: {},
geometry: {
coordinates: [
[
[-117.42351735397804, 47.659839523657155],
[-117.42351735397804, 47.6533360375098],
[-117.41165191515506, 47.6533360375098],
[-117.41165191515506, 47.659839523657155],
[-117.42351735397804, 47.659839523657155]
],
],
type: "Polygon",
},
} as GeoJSON.Feature;
// Initialize pipeline
const pipeline = await geoai.pipeline(
[{ task: "building_footprint_segmentation" }],
providerParams
);
// Run detection
const result = await pipeline.inference({
inputs: { polygon }
});
// Sample output format
// {
// "detections": {
// "type": "FeatureCollection",
// "features": [
// {
// "type": "Feature",
// "properties": {
// "confidence": 0.8438083529472351
// },
// "geometry": {
// "type": "Polygon",
// "coordinates": [
// [
// [-117.41771164648438, 47.650790343749996],
// [-117.41766873046875, 47.650790343749996],
// [-117.41762581445313,47.650790343749996],
// ...
// [-117.41771164648438, 47.650790343749996]
// ]
// ]
// }
// },
// {"type": 'Feature', "properties": {…}, "geometry": {…}},
// {"type": 'Feature', "properties": {…}, "geometry": {…}},
// ]
// },
// "geoRawImage": GeoRawImage {data: Uint8ClampedArray(1048576), width: 512, height: 512, channels: 4, bounds: {…}, …}
// }
```
### 📖 Documentation & Demo
- GeoBase Docs: https://docs.geobase.app/geoai
- NPM Package: https://www.npmjs.com/package/geoai
- Demo Playground: https://docs.geobase.app/geoai-live/tasks/building-footprint-segmentation
- GitHub Repo: https://github.com/decision-labs/geoai.js |