add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- geospatial
|
| 4 |
+
- geobase
|
| 5 |
+
- building-detection
|
| 6 |
+
- building-footprint-detection
|
| 7 |
+
---
|
| 8 |
+
| <img src="https://upload.wikimedia.org/wikipedia/commons/6/6a/JavaScript-logo.png" width="28" height="28"> | [@geobase-js/geoai](https://www.npmjs.com/package/@geobase-js/geoai) |
|
| 9 |
+
|---|---|
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
> `task = building-detection`
|
| 14 |
+
|
| 15 |
+
### π Model Purpose
|
| 16 |
+
This model is part of the **[@geobase-js/geoai](https://github.com/geobase-ai/geoai)** javascript library.
|
| 17 |
+
|
| 18 |
+
**GeoAi** enables geospatial AI inference **directly in the browser or Node.js** without requiring a heavy backend.
|
| 19 |
+
|
| 20 |
+
**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**.
|
| 21 |
+
|
| 22 |
+
<video controls autoplay loop width="1024" height="720" src="https://geobase-docs.s3.amazonaws.com/geobase-ai-assets/building-detection.mp4"></video>
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
### π Demo
|
| 26 |
+
|
| 27 |
+
Explore the model in action with the interactive [Demo](https://docs.geobase.app/geoai-live/tasks/building-detection).
|
| 28 |
+
|
| 29 |
+
### π¦ Model Information
|
| 30 |
+
- **Architecture**: MaskRCNN
|
| 31 |
+
- **Source Model**: https://opengeoai.org/examples/train_building_footprints_usa
|
| 32 |
+
- **Quantization**: Yes
|
| 33 |
+
---
|
| 34 |
+
|
| 35 |
+
### π‘ Example Usage
|
| 36 |
+
|
| 37 |
+
```javascript
|
| 38 |
+
import { geoai } from "@geobase-js/geoai";
|
| 39 |
+
|
| 40 |
+
// Example polygon (GeoJSON)
|
| 41 |
+
const polygon = {
|
| 42 |
+
type: "Feature",
|
| 43 |
+
properties: {},
|
| 44 |
+
geometry: {
|
| 45 |
+
coordinates: [
|
| 46 |
+
[
|
| 47 |
+
[-117.59239617156095, 47.653614113446906],
|
| 48 |
+
[-117.59239617156095, 47.652878388765174],
|
| 49 |
+
[-117.59040545822742, 47.652878388765174],
|
| 50 |
+
[-117.59040545822742, 47.653614113446906],
|
| 51 |
+
[-117.59239617156095, 47.653614113446906]
|
| 52 |
+
],
|
| 53 |
+
],
|
| 54 |
+
type: "Polygon",
|
| 55 |
+
},
|
| 56 |
+
} as GeoJSON.Feature;
|
| 57 |
+
|
| 58 |
+
// Initialize pipeline
|
| 59 |
+
const pipeline = await geoai.pipeline(
|
| 60 |
+
[{ task: "building-detection" }],
|
| 61 |
+
providerParams
|
| 62 |
+
);
|
| 63 |
+
|
| 64 |
+
// Run detection
|
| 65 |
+
const result = await pipeline.inference({
|
| 66 |
+
inputs: { polygon }
|
| 67 |
+
});
|
| 68 |
+
|
| 69 |
+
// Sample output format
|
| 70 |
+
// {
|
| 71 |
+
// "detections": {
|
| 72 |
+
// "type": "FeatureCollection",
|
| 73 |
+
// "features": [
|
| 74 |
+
// {
|
| 75 |
+
// "type": "Feature",
|
| 76 |
+
// "properties": {
|
| 77 |
+
// },
|
| 78 |
+
// "geometry": {
|
| 79 |
+
// "type": "Polygon",
|
| 80 |
+
// "coordinates": [
|
| 81 |
+
// [
|
| 82 |
+
// [54.69479163045772, 24.766579711184693],
|
| 83 |
+
// [54.69521093930892, 24.766579711184693],
|
| 84 |
+
// [54.69521093930892, 24.766203991224682],
|
| 85 |
+
// [54.69479163045772, 24.766203991224682],
|
| 86 |
+
// [54.69479163045772, 24.766579711184693],
|
| 87 |
+
// ]
|
| 88 |
+
// ]
|
| 89 |
+
// }
|
| 90 |
+
// },
|
| 91 |
+
// {"type": 'Feature', "properties": {β¦}, "geometry": {β¦}},
|
| 92 |
+
// {"type": 'Feature', "properties": {β¦}, "geometry": {β¦}},
|
| 93 |
+
// ]
|
| 94 |
+
// },
|
| 95 |
+
// "geoRawImage": GeoRawImage {data: Uint8ClampedArray(1048576), width: 512, height: 512, channels: 4, bounds: {β¦}, β¦}
|
| 96 |
+
// }
|
| 97 |
+
|
| 98 |
+
```
|
| 99 |
+
### π Documentation & Demo
|
| 100 |
+
|
| 101 |
+
- GeoBase Docs: https://docs.geobase.app/geoai
|
| 102 |
+
- NPM Package: https://www.npmjs.com/package/@geobase-js/geoai
|
| 103 |
+
- Demo Playground: https://docs.geobase.app/geoai-live/tasks/building-detection
|
| 104 |
+
- GitHub Repo: https://github.com/decision-labs/geobase-ai.js
|