State-of-the-art cloud and cloud shadow segmentation for high to moderate resolution satellite imagery.
Works with any imagery containing Red, Green, and NIR bands at 10-50 m resolution. Validated on Sentinel-2, Landsat 8, PlanetScope and Maxar imagery.
Documentation | Paper | Training Data Map | Podcast
pip install omnicloudmaskOr with uv, conda, or from source—see installation docs.
import numpy as np
from omnicloudmask import predict_from_array
# Input: (3, height, width) array with Red, Green, NIR bands
input_array = np.random.rand(3, 1024, 1024).astype(np.float32)
# Output: (1, height, width) mask
# Values: 0=Clear, 1=Thick Cloud, 2=Thin Cloud, 3=Cloud Shadow
mask = predict_from_array(input_array)For a Sentinel-2 scene:
from pathlib import Path
from omnicloudmask import predict_from_load_func, load_s2
scene_paths = [Path("path/to/scene.SAFE")]
pred_paths = predict_from_load_func(scene_paths, load_s2)See the quickstart guide for more examples.
MIT License