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