https://github.com/decision-labs/geoai.js
🛰️ GeoAI.js is a javascript library for use with transformers.js to perform GeoAI on the frontend
https://github.com/decision-labs/geoai.js
drone frontend geoai javascript maps nodejs satelliteimagery transformersjs
Last synced: 8 months ago
JSON representation
🛰️ GeoAI.js is a javascript library for use with transformers.js to perform GeoAI on the frontend
- Host: GitHub
- URL: https://github.com/decision-labs/geoai.js
- Owner: decision-labs
- License: mit
- Created: 2024-12-02T06:32:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-27T21:47:20.000Z (9 months ago)
- Last Synced: 2025-10-01T18:40:09.561Z (8 months ago)
- Topics: drone, frontend, geoai, javascript, maps, nodejs, satelliteimagery, transformersjs
- Language: TypeScript
- Homepage: https://docs.geobase.app/geoai-live
- Size: 59.6 MB
- Stars: 102
- Watchers: 6
- Forks: 10
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
GeoAI
A lightweight JavaScript library for running Geo AI models in frontend applications.
Caption: example of feature extraction using the transformerjs version of dino v3, see examples at docs.geobase.app/geoai-live
### Quick install
### NPM Package
[](https://www.npmjs.com/package/geoai)
[](https://www.npmjs.com/package/geoai)
```bash
npm i geoai
```
📦 **Package Links:**
- [npm package](https://www.npmjs.com/package/geoai)
- [jsDelivr CDN](https://www.jsdelivr.com/package/npm/geoai)
### CDN (Browser)
You can also use GeoAI directly in the browser via CDN:
#### Unpkg CDN
```html
```
#### jsDelivr CDN
```html
```
When using CDN, the library is available globally as `geoai`.
Get Started: Follow the [Quickstart Guide](https://docs.geobase.app/geoai) or clone the quick start example.
```bash
git init
touch README.md
git add .
git commit -m "Initial commit"
git subtree add --prefix=examples/01-quickstart https://github.com/decision-labs/geoai.js main --squash
```
## Usage
### Core Library (Node.js and Browser)
#### NPM Installation
```javascript
import { geoai } from "geoai";
// Initialize the pipeline with ESRI provider (no API key required)
const pipeline = await geoai.pipeline([{ task: "object-detection" }], {
provider: "esri",
});
// Run inference
const result = await pipeline.inference({
inputs: {
polygon: geoJsonFeature,
},
mapSourceParams: {
zoomLevel: 18,
},
});
```
#### CDN Usage
```javascript
// When using CDN, geoai is available globally
const pipeline = await geoai.pipeline([{ task: "object-detection" }], {
provider: "esri",
});
const result = await pipeline.inference({
inputs: {
polygon: geoJsonFeature,
},
mapSourceParams: {
zoomLevel: 18,
},
});
```
### React Hooks
```javascript
import { useGeoAIWorker } from "geoai/react";
function MyComponent() {
const { inference, isLoading, error } = useGeoAIWorker({
tasks: ["object-detection"],
provider: "esri", // No API key required for ESRI
});
const handleInference = async () => {
const result = await inference({
inputs: { polygon: geoJsonFeature },
mapSourceParams: { zoomLevel: 18 },
});
};
return (
{isLoading ? "Processing..." : "Run Detection"}
{error && Error: {error.message}}
);
}
```
## Features
- **Multiple AI Tasks**: Object detection, segmentation, classification, and more
- **Map Provider Support**: Geobase, Mapbox, ESRI, and Google Maps
- **React Integration**: Hooks for easy React integration
- **TypeScript Support**: Full TypeScript definitions
- **Web Worker Support**: Run AI models in background threads
- **Optimized Performance**: Efficient model loading and inference
- **CDN Ready**: Available via npm and popular CDNs (unpkg, jsDelivr)
## Supported Tasks
- Object Detection
- Building Detection
- Car Detection
- Ship Detection
- Solar Panel Detection
- Oil Storage Tank Detection
- Land Cover Classification
- Wetland Segmentation
- Building Footprint Segmentation
- Mask Generation
- Zero-shot Object Detection
- Zero-shot Segmentation
- Image Feature Extraction
For more see the [supported tasks](https://docs.geobase.app/geoai/supported-tasks)
## Links
- **Documentation**: [docs.geobase.app/geoai](https://docs.geobase.app/geoai) - Comprehensive documentation, examples, and API reference
- **Live Examples**: [docs.geobase.app/geoai-live](https://docs.geobase.app/geoai-live) - Interactive examples and demos
- **Community**: [GitHub Discussions](https://github.com/decision-labs/geoai.js/discussions) - Ask questions, share ideas, and connect with other developers
- **Code**: [GitHub Repository](https://github.com/decision-labs/geoai.js) - Source code and contributions
- **Issues**: [GitHub Issues](https://github.com/decision-labs/geoai.js/issues) - Report bugs and request features
## Contributing
We welcome contributions! Please see our [contributing guide](CONTRIBUTING.md) for details.
## License
MIT License - see [LICENSE.md](LICENSE.md) for details.
[//]: <> (Toggle CI on)