Views
No views yet
task = oil-storage-tank-detection
1import { geoai } from "geoai";
2
3// Example polygon (GeoJSON)
4const polygon = {
5 type: "Feature",
6 properties: {},
7 geometry: {
8 coordinates: [
9 [
10 [54.68328454841432, 24.762795008216074],
11 [54.684149555501506, 24.756239186864462],
12 [54.69506195259541, 24.755710476520136],
13 [54.694196945508224, 24.76320284742259],
14 [54.68328454841432, 24.762795008216074],
15 ],
16 ],
17 type: "Polygon",
18 },
19} as GeoJSON.Feature;
20
21// Initialize pipeline
22const pipeline = await geoai.pipeline(
23 [{ task: "oil-storage-tank-detection" }],
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",
36// "features": [
37// {
38// "type": "Feature",
39// "properties": {
40// "confidence": 0.8438083529472351
41// },
42// "geometry": {
43// "type": "Polygon",
44// "coordinates": [
45// [
46// [54.69479163045772, 24.766579711184693],
47// [54.69521093930892, 24.766579711184693],
48// [54.69521093930892, 24.766203991224682],
49// [54.69479163045772, 24.766203991224682],
50// [54.69479163045772, 24.766579711184693],
51// ]
52// ]
53// }
54// },
55// {"type": 'Feature', "properties": {…}, "geometry": {…}},
56// {"type": 'Feature', "properties": {…}, "geometry": {…}},
57// ]
58// },
59// "geoRawImage": GeoRawImage {data: Uint8ClampedArray(1048576), width: 512, height: 512, channels: 4, bounds: {…}, …}
60// }
61