Prithvi-EO 2.0 Sen1Floods11

PRITHVI_EO_2_SEN1FLOODS11

Maps water and floods from satellite images: send a Sentinel-2 GeoTIFF and get a water mask at the image's size, with its box, score, share of water and the map coordinates to place it. Fine-tune it on your own labelled images.

Utilitiesimage-segmentationflood-mappingwater-extentsatellitesentinel-2geospatialapache-2.0Fine-tunable
Prithvi-EO 2.0 Sen1Floods11: Utilities model on Kainguru

About Prithvi-EO 2.0 Sen1Floods11

Capabilities

  • Water and flood masks — the water of a Sentinel-2 image as a mask at the image's size, with its box, score and the share of the image it covers
  • On the map — the result carries the image's coordinate system, transform and bounds, so the mask can be placed on a map
  • Six bands or 13 — blue, green, red, narrow NIR, SWIR 1 and SWIR 2, or a whole Sentinel-2 L1C product, from which the six are picked
  • Fine-tunable — train it on your own labelled images, for other regions or other kinds of water

Good to know

  • The model reads Sentinel-2 optical imagery, not Sentinel-1 radar. Send a GeoTIFF (name it .tiff; .tif files are not accepted) of up to 20 MB and 16 megapixels, at least 32 pixels a side, holding the six bands blue, green, red, narrow NIR (B8A), SWIR 1 (B11) and SWIR 2 (B12) in this order, or all 13 bands of a Sentinel-2 L1C product, with 16-bit integer or 32-bit float values.
  • Values are multiplied by the scale (0.0001 by default, for Sentinel-2's integer numbers; use 1 if they already are reflectance, 0 to 1). A pixel equal to the file's nodata value, -9999 or not a number counts as empty.
  • The model was trained on 512 x 512 chips at 10 m resolution. The image is read in 512 x 512 windows without overlap, padded at its right and bottom edges by reflection, so a window of mostly padding gives less certain results at the edge. The 16 megapixels are counted with each side rounded up to a multiple of 512 (a 4096 x 4096 image just fits), so a very thin strip, such as 32 x 524288 pixels, is refused.
  • A pixel is water where the model's water probability is over the threshold (0.5 by default); lower it to find more water. The result has one water segment if any pixel is water: its score is the mean probability over its pixels, its mask a COCO RLE at the image's size, scaled down to 2048 pixels on the longer side (the box stays in the image's pixels), and water_fraction is the share of the image's valid pixels that is water.
  • Fine-tuning takes one ZIP (at most 4 GB, no password) with 4 to 1000 GeoTIFF chips, a one-band label GeoTIFF of the same size for each and a manifest.jsonl with one line per pair: {"image": "chips/a.tiff", "mask": "labels/a.tiff"}. Paths are relative to the manifest. Chips are 224 to 1024 pixels a side with the six bands above, in the same order, or 13 bands, and hold 262 megapixels together at most. Chip values are multiplied by the scale parameter (0.0001 by default, for Sentinel-2 integer numbers; use 1 for chips that already hold reflectance, 0 to 1); send a fine-tuned model images in the same units, with the matching scale.
  • A label has the values 0 (no water) and 1 (water); 255, -1 and the file's nodata value leave a pixel out. Training uses a random 224 x 224 crop of each chip, flipped horizontally and vertically half the time, with AdamW and a cosine schedule, and stops after 5,000 steps or 9 hours, whichever comes first, keeping what it learned. The whole network learns; the classes stay no water and water.

Attribution

Prithvi-EO-2.0 by IBM and NASA (ibm-nasa-geospatial), released under the Apache License 2.0, fine-tuned for flood mapping on Sen1Floods11 (Bonafilia et al.); the network code is TerraTorch's (Apache License 2.0).

Prithvi-EO 2.0 Sen1Floods11 inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—A GeoTIFF (name it .tiff) of up to 20 MB and 16 megapixels (sides rounded up to a multiple of 512) with the six Sentinel-2 bands blue, green, red, narrow NIR (B8A), SWIR 1 (B11), SWIR 2 (B12), in this order, or all 13 bands of a Sentinel-2 L1C product.
1–2048 characters · image/tiff
scalenumberNo0.0001What the file's values are multiplied by to give reflectance (0 to 1): 0.0001 for Sentinel-2's integer numbers, 1 for values that already are reflectance.
0.000001–1
thresholdnumberNo—Lowest water probability of a water pixel, 0 to 1; lower finds more water. Empty uses 0.5.
0–1

Output. JSON: {"width", "height", "segments": [{"label", "score", "box", "mask"}] (one "water" segment if any), "water_fraction", "geo": {"crs", "transform", "bounds"}}: box in pixels, mask a COCO RLE {"size": [h, w], "counts"}.

Run Prithvi-EO 2.0 Sen1Floods11 with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=PRITHVI_EO_2_SEN1FLOODS11" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png",
    "scale": 1.0E-4
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "PRITHVI_EO_2_SEN1FLOODS11",
        {
          "image": "https://example.com/input.png",
          "scale": 1.0E-4
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune Prithvi-EO 2.0 Sen1Floods11

You can fine-tune Prithvi-EO 2.0 Sen1Floods11 on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, no password) with 4 to 1000 GeoTIFF chips (224 to 1024 pixels a side), a one-band label GeoTIFF for each (0 no water, 1 water, 255 left out) and a manifest.jsonl of {"image", "mask"} lines. More: Good to know, README.

The steps are in the docs.

Prithvi-EO 2.0 Sen1Floods11 pricing

Price per image: 0.0874 credits ($0.000874). The price is shown again before every run; all prices are on the pricing page.

Licence and source

SAM 2.1 Hiera Large: Utilities model on Kainguru
Utilities

SAM 2.1 Hiera Large

Click or draw a box on an object and get back a mask outlining it.

Fine-tunable
Grounded SAM 2: Utilities model on Kainguru
Utilities

Grounded SAM 2

Outlines the things you name in a picture, such as "red car, person with a helmet", with a mask and a box for each one.

Fine-tunable
Rembg U2-Net: Utilities model on Kainguru
Utilities

Rembg U2-Net

Fast background removal that returns the subject of a photo on a transparent background, or as a black-and-white mask.

Fine-tunable
RF-DETR Seg 2XLarge: Utilities model on Kainguru
Utilities

RF-DETR Seg 2XLarge

Finds every object of 80 everyday kinds in a picture, such as people, vehicles, animals and furniture, and outlines…

Fine-tunable
BiRefNet General: Utilities model on Kainguru
Utilities

BiRefNet General

Removes the background from a photo and returns the subject on a transparent background, or as a black-and-white mask.

Fine-tunable
Cloth Segmentation U2-Net: Utilities model on Kainguru
Utilities

Cloth Segmentation U2-Net

Finds the clothes a person wears in a photo and returns a mask for the upper body, the lower body and full-body…

Fine-tunable