Skip to main content

Flood super-resolution CLI and library using ONNX Runtime.

Project description

floodsr

CI Release Documentation Status

Super-Resolution for flood hazard rasters. Ingests lores water grid and hires DEM and infers a hires water grid using the specified model.

Documentation: https://floodsr.readthedocs.io/en/latest/

Implemented models (see floodsr/models.json):

  • ResUNet_16x_DEM: 16x DEM-conditioned ResUNet
  • CostGrow (future)

Implemented backend:

  • ONNX Runtime

Installation

# recommended core install: isolated CLI install for users
python -m pip install --user pipx
pipx ensurepath
pipx install floodsr

TestPyPI install:

pipx install --index-url https://test.pypi.org/simple/ --pip-args="--extra-index-url https://pypi.org/simple" floodsr

Extended install for GDAL/VRT-dependent workflows:

sudo apt-get update
sudo apt-get install -y gdal-bin libgdal-dev
python -m pip install "gdal==$(gdal-config --version)"
python -m pip install "floodsr[extended]"

The default floodsr package is the core install. It does not require osgeo.gdal, and the HRDEM fetcher falls back to the non-windowed path when GDAL bindings are missing.

Developer work should use the devcontainer image in .devcontainer/main/devcontainer.json.

Use

Current CLI surface includes model registry, tohr raster execution, and runtime diagnostics.

List available model versions:

# source checkout shortcut for the CLI
alias floodsr='python -m floodsr.cli'

floodsr models list

Fetch a model by version into the default cache:

floodsr models fetch ResUNet_16x_DEM --force

tohr using HRDEM as DEM

floodsr tohr -f --in tests/data/2407_FHIMP_tile/lowres032.tif 

Run one ToHR pass from raster inputs:

# simple tile
floodsr tohr \
  --in tests/data/2407_FHIMP_tile/lowres032.tif \
  --dem tests/data/2407_FHIMP_tile/hires002_dem.tif  

# larger raster w/ windowing and tiling and rescaling
floodsr tohr \
  --in tests/data/rss_mersch_A/lowres030.tif \
  --dem tests/data/rss_mersch_A/hires002_dem.tif \
  --out pred_sr.tif
 

Run ToHR with explicit local model path:

floodsr tohr \
  --in tests/data/2407_FHIMP_tile/lowres032.tif \
  --dem tests/data/2407_FHIMP_tile/hires002_dem.tif \
  --out ./tmp/pred_sr.tif \
  --model-path _inputs/ResUNet_16x_DEM/model_infer.onnx

Doctor diagnostics:

floodsr doctor

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

floodsr-0.0.3.tar.gz (18.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

floodsr-0.0.3-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file floodsr-0.0.3.tar.gz.

File metadata

  • Download URL: floodsr-0.0.3.tar.gz
  • Upload date:
  • Size: 18.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for floodsr-0.0.3.tar.gz
Algorithm Hash digest
SHA256 49854c2ab4ff7f3c099fd13c87132276ebf2c9f3ae88fef20f4f8cf823bbe9d8
MD5 e06899711b42a09b9da21d0db5482de4
BLAKE2b-256 4be8102dad9903e5c267167432a22921ea406b325eae42a483a58d8e18b0f3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for floodsr-0.0.3.tar.gz:

Publisher: release.yml on cefect/floodsr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file floodsr-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: floodsr-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for floodsr-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9819363bf2b791874a7350bcee7cf9f5536d01f86f0373bb5d64039edb33fdb8
MD5 b79c428fe6c8234b5ced001d018f27f2
BLAKE2b-256 7119bdf9fc1fb5c094022446b6ce7397e60da0e77cdc819f9f173e865b4adb16

See more details on using hashes here.

Provenance

The following attestation bundles were made for floodsr-0.0.3-py3-none-any.whl:

Publisher: release.yml on cefect/floodsr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page