Skip to main content

Flood super-resolution CLI and library using ONNX Runtime.

Project description

floodsr

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: 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

Developer install:

pip install -e ".[dev]"

Use

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

List available model versions:

# dev 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.1.tar.gz (40.9 kB 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.1-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: floodsr-0.0.1.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for floodsr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 59bbc8cafc5c42eb2298d7a57710146ecf98bce39ed32f66fea4e2657f96f4a0
MD5 07c5c29b404511295a2a823d74f5e372
BLAKE2b-256 d8c6ddc5339e073bad521e65da162ae480780fde2380a0bfad90a2be93041064

See more details on using hashes here.

File details

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

File metadata

  • Download URL: floodsr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for floodsr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c08245c0527ab4957304184e35db989ef92746b7a99a470597d1d27adaeabe
MD5 fc4fd2b9adb4dd2fee3004735c17297c
BLAKE2b-256 0a7901aee0b09777b1c3c493685832990c120cb1f046d9026816eaf0dc41ad7b

See more details on using hashes here.

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