Skip to main content

pygeovision

From "I need imagery of this place" to a finished map, mask or dataset: search, preprocess, model and assess in one package.

PyPI Python License: MIT DOI Providers Pipelines Models Docs

Features · Installation · Quick start · Case studies · Command line · Pipelines · OBIA · Status · Citation · Documentation


Status: actively developed. The core workflow (search → download → preprocess → run a model → assess) is tested, but not every part is equally mature. See Project status before you rely on a feature.

Statement of need

Applying AI to satellite imagery is slowed down less by the models than by everything around them. A typical project joins a provider-specific download library, a preprocessing script, a modelling framework and a pile of one-off code for masks, tiling, reports and accuracy checks. Each join is a place where results quietly go wrong: a cloud pixel treated as a class, a reprojection that shifts a mask, a model run on the wrong bands. Whole scenes of about a gigabyte are downloaded to analyse a few square kilometres, and the steps are rarely scripted in a way that someone else can rerun.

Existing tools cover parts of this chain well: data access, deep-learning training, object-based analysis. Few cover the whole path from "I need imagery of this place" to a documented, reproducible result, and fewer say plainly which parts have been checked against real data. pygeovision is written for geospatial researchers who want satellite data and AI in one import, ML practitioners who would rather not hand-roll provider APIs, and teams who need scriptable, schedulable workflows.

Objectives

  1. One interface to the data. Search and download from 22 providers through pygeofetch, fetching only the study area when possible.
  2. Trustworthy preprocessing. Cloud and nodata pixels are masked, never classified; inputs are validated before they reach a model.
  3. Models inside the package. Segmentation, detection, change detection, classification and foundation-model embeddings, with training, losses and tiled inference for full scenes, and no separate AI-platform account.
  4. From bounding box to deliverable. Pipelines that return maps, vector layers, statistics and a PDF/Word/Excel report in a single call or command.
  5. Object-based image analysis. Segmentation, object features, classification and object-level accuracy, each checked against an independent reference.
  6. Honesty about maturity. The documentation states what was tested on real data, what only on synthetic data, and what is deliberately unimplemented.

Features

Area What you get
Data 22 providers; resumable downloads with checksums; AOI-only streaming with fallback to a full download; chained post-processing; YAML pipelines with cron scheduling
Preprocessing Cloud masking, band stacking, 21 spectral indices, AI-ready preparation, a data validator
Models Segmentation, detection, change detection, CLIP zero-shot classification, foundation-model embeddings
Pipelines 42 end-to-end workflows with reports and vector outputs
OBIA Ten segmentation methods, object features, rule, fuzzy and supervised classification, object-level accuracy
Labeling and explainability Labels from OpenStreetMap, building footprints, WorldCover and SAM; Grad-CAM, uncertainty, SHAP
Monitoring and deployment Drift detection and alerting; ONNX Runtime, NVIDIA Jetson, AWS, Azure and GCP deployers

Installation

pip install pygeovision                # core: data search/download + band-math inference
pip install "pygeovision[geo]"         # rasterio, geopandas, ...
pip install "pygeovision[train]"       # PyTorch and training tools
pip install "pygeovision[obia]"        # scikit-image, scikit-learn (OBIA)
pip install "pygeovision[report]"      # PDF/Word/Excel reports for pipeline runs
pip install "pygeovision[all]"         # everything except cloud/edge

Python 3.10 or newer. PyTorch is only needed for training and deep-model inference. The full list of extras is in the documentation.

Quick start

import pygeovision as pgv

client = pgv.PyGeoVision()

results = client.search(bbox=(38.6, 8.9, 38.95, 9.15),
                        date_range=("2024-01-01", "2024-04-30"),
                        cloud_cover_max=15)
scene = client.download(results[:1], output_dir="./data",
                        bands=["B02", "B03", "B04", "B08", "B11", "B12"])[0]

ready = client.prepare_for_ai(scene.path, model_type="foundation", output_path="./data/ready.tif")
client.classification.land_cover(ready["output_path"], output_path="./land_cover.tif")

Case studies

Two complete analyses built on pygeovision, written for the course 856.114 GeoHumanitarian Action (University of Salzburg, 2026). Both run in Google Colab with one click and need no Google Earth Engine account.

Piura, Peru: urban growth 2020–2025 San Donà di Piave, Italy: health access in a 100-year flood
Notebook piura-urban-growth-pygeovision Open In Colab sandona-health-access-pygeovision Open In Colab

Building footprints from Microsoft, Google and OpenStreetMap read with pygeovision, on a Sentinel-2 image

Piura: building footprints from Microsoft (left), Google (centre) and OpenStreetMap (right). The same 2.76 km² box holds 321 to 1,141 buildings depending on the source.

Walking time to the nearest critical health facility, normal conditions and 100-year flood

San Donà: walking time to the nearest critical health facility, normal conditions (left) and 100-year flood (right). Buildings within 60 minutes of critical care fall from 78.4 % to 21.6 %.

Command line

Everything above is also available from the shell:

pygeovision data search --bbox -74.1 40.6 -73.7 40.9 --date 2024-06 --satellite sentinel-2
pygeovision data download --bbox -74.1 40.6 -73.7 40.9 --date 2024-06 --output ./data/
pygeovision channel list
pygeovision channel building_footprints --bbox -0.15 51.47 -0.10 51.52 --date 2024-06
pygeovision status    # what is installed and working
pygeovision doctor    # diagnose a broken setup

End-to-end pipelines

42 pipelines run from Python (client.pipeline(name, ...)) and from the CLI (pygeovision channel <name>). 35 run out of the box (flood, fire, snow, water, land cover, terrain, buildings, roads and more); 7 run a network you trained yourself and refuse to start without checkpoint=. Every run also writes a deliverables folder with a map, vector layers, statistics and a PDF/Word/Excel report (pip install "pygeovision[report]"). pygeovision channel list shows each pipeline; the documentation describes them one by one.

client.pipeline("wildfire_severity", bbox=bbox, output_dir="out", date_before="2018-10", date_after="2018-12")

Models and training

Architectures are registered by name (pygeovision models list): SegFormer, Mask2Former, DETR, ChangeFormer, SAM, CLIP, DINOv2, Prithvi, DOFA and a native hub including U-Net and DeepLabV3+. Training supports fine-tuning from a checkpoint, geospatial losses, mixed precision, gradient accumulation and multi-GPU, and inference runs in Gaussian-blended tiles so a model trained on small chips can process a full scene. The registry holds architectures, not trained weights.

Object-based image analysis (OBIA)

Analyse imagery as objects instead of pixels: segment, describe, classify, assess.

from pygeovision import obia

rd    = obia.fetch_scene(client, (-1.70, 6.18, -1.655, 6.225), "2024-01", "./download")  # Sentinel-2, cloud-masked
seg   = obia.segment(rd, "multires", scale=16)                                           # cloud pixels become label 0
feats = obia.extract_features(seg.labels, rd, extra_layers=obia.spectral_layers(rd))
rules = obia.RuleBasedClassifier([("water", "mean_ndwi > 0.3"), ("vegetation", "mean_ndvi > 0.5")], default="other")
result = rules.classify(feats)

Ten segmentation methods are available (multires, spectral_difference, quadtree, multi_threshold, contrast_split, slic, felzenszwalb, quickshift, watershed, chessboard). multires follows the published Baatz & Schäpe criterion and is not a clone of eCognition. See the OBIA guide.

Project status

  • Pipelines: most were tested on synthetic rasters with known answers. building_footprints, road_network, terrain_analysis, urban_expansion and the Sentinel-2 readers have also run on real data in the case studies. Optical pipelines are limited by clouds, haze and shadow.
  • Deep-learning layer: verified offline with synthetic data and tiny random models, never with pretrained weights, a GPU or real scenes. Treat first runs on your data as validation runs.
  • Your own weights: seven pipelines and the infer commands run a network you trained; pygeovision ships no weights for them. Some features download model weights on first use.
  • Placeholders: a few registry entries are deliberately unimplemented and raise NotImplementedError.

Details, removed features and the roadmap are in the documentation.

Testing

pip install "pygeovision[dev,train,geo,obia]"
pytest tests/

Documentation

Full documentation, with a guide for every pipeline, command and OBIA step: https://appiahkubis14.github.io/pygeovision-docs/.

Citation

If you use pygeovision in your work, please cite it:

Appiah Kubi, S. (2026). pygeovision: A Unified Open-Source Python Platform for Satellite Earth Observation AI (Version 2.1.9) [Software]. Zenodo. https://doi.org/10.5281/zenodo.22258220

@software{appiah_kubi_2026_pygeovision,
  author    = {Appiah Kubi, Samuel},
  title     = {pygeovision: A Unified Open-Source Python Platform for Satellite Earth Observation AI},
  year      = {2026},
  version   = {2.1.9},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.22258220},
  url       = {https://doi.org/10.5281/zenodo.22258220}
}

Please also cite pygeofetch, the satellite data layer: Appiah Kubi, S. (2026). pygeofetch: A Unified Python Framework for Multi-Provider Satellite Data Acquisition, Pre-download Quality Control, and Geospatial Processing (Version v2.6.2.1) [Software]. Zenodo. https://doi.org/10.5281/zenodo.22087230

Contributing and license

Contributions are welcome; see the contributing guide. pygeovision is released under the MIT License.

The satellite data layer is built on pygeofetch. The case studies use data from OpenStreetMap contributors (ODbL), Microsoft Global ML Building Footprints (ODbL), Google Open Buildings v3 (CC BY 4.0), GHSL R2023A (JRC), JRC / Copernicus GloFAS flood hazard maps, Copernicus Sentinel-2 and GLO-30 DEM (ESA), and HeiGIT openrouteservice; their full credits are in the notebooks.

Metadata

Release files for pygeovision 2.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygeovision 2.2.2
File Size Uploaded Provenance Actions
pygeovision-2.2.2.tar.gz 1.3 MB Without provenance Details for pygeovision-2.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygeovision 2.2.2
File Interpreter ABI Platform Actions
pygeovision-2.2.2-py3-none-any.whl Python 3 none any Details for pygeovision-2.2.2-py3-none-any.whl

Total release size: 2.3 MB

Release files / pygeovision-2.2.2.tar.gz

Download URL pygeovision-2.2.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
6760be00afb9c24e95ddda2f9c965939d04062928a20bae5231f0933ce1177ad
BLAKE2b-256 checksum
How to use checksums
c758a9b229c1d516b3aeab0997713febb409d25657ec2fde737509a115bc02ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pygeovision-2.2.2-py3-none-any.whl

Download URL pygeovision-2.2.2-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5f6904753bf43e465151531e09a83f956ebe02957025640d7f5486eab1532fea
BLAKE2b-256 checksum
How to use checksums
2366b89f9e0b24f6ab360b38b4327bab63d2e04d93da653bd62b3bee23f8b53c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pygeovision 2.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page