Views
No views yet
task = land-cover-classification
Note: This model only works if the input imagery contains both RGB and NIR bands.
1import { geoai } from "geoai";
2
3// Example polygon (GeoJSON)
4const polygon = {
5 type: "Feature",
6 properties: {},
7 geometry: {
8 coordinates: [
9 [
10 [-99.98170823334205, 50.64318249608178],
11 [-99.9806018185983, 50.6431476272638],
12 [-99.9807117895183, 50.642403469489295],
13 [-99.98256386074388, 50.64247150726101],
14 [-99.98170823334205, 50.64318249608178]
15 ],
16 ],
17 type: "Polygon",
18 },
19} as GeoJSON.Feature;
20
21// Initialize pipeline
22const pipeline = await geoai.pipeline(
23 [{ task: "land-cover-classification" }],
24 providerParams
25);
26
27// Run detection
28const result = await pipeline.inference({
29 inputs: { polygon }
30});
31
32// Sample output format
33// {
34// "detections": [
35// {type: 'FeatureCollection', features: Array(6)},
36// {type: 'FeatureCollection', features: Array(43)},
37// {type: 'FeatureCollection', features: Array(6)},
38// {type: 'FeatureCollection', features: Array(3)},
39// {type: 'FeatureCollection', features: Array(11)},
40// {type: 'FeatureCollection', features: Array(36)},
41// {type: 'FeatureCollection', features: Array(0)},
42// {type: 'FeatureCollection', features: Array(9)}
43// ]
44// "outputimage": GeoRawImage {data: Uint8ClampedArray(1048576), width: 512, height: 512, channels: 4, bounds: {…}, …}
45// }
46