Skip to main content

The ICEBERG Rivers usecase package

Project description

Rivers (Arctic hydrology)

We provide a classification algorithm for ice surface features from high-resolution imagery. This algorithm was developed by convolutional neural network training to detect regions of large and small rivers and to distinguish them from crevasses and non-channelized slush. We also provide a detection algorithm to extract polyline water features from the classified high-probability river areas.

Prerequisites - all available on bridges via the commands below

  • Linux
  • Python 3
  • CPU and NVIDIA GPU + CUDA CuDNN

Software Dependencies - these will be installed automatically with the installation below.

  • numpy
  • scipy
  • tifffile
  • keras >= 1.0
  • tensorboardX==1.8
  • opencv-python
  • rasterio
  • affine
  • pygdal == 1.11.4.6
  • tensorflow

Installation

Preliminaries:
These instructions are specific to XSEDE Bridges but other resources can be used if cuda, python3, and a NVIDIA P100 GPU are present, in which case 'module load' instructions can be skipped, which are specific to Bridges.

For Unix or Mac Users:
Login to bridges via ssh using a Unix or Mac command line terminal. Login is available to bridges directly or through the XSEDE portal. Please see the Bridges User's Guide.

For Windows Users:
Many tools are available for ssh access to bridges. Please see Ubuntu, MobaXterm or PuTTY

PSC Bridges

Once you have logged into bridges, you can follow one of two methods for installing iceberg-rivers.

Method 1 (Recommended):

The lines below following a '$' are commands to enter (or cut and paste) into your terminal (note that all commands are case-sensitive, meaning capital and lowercase letters are differentiated.) Everything following '#' are comments to explain the reason for the command and should not be included in what you enter. Lines that do not start with '$' or '[rivers_env] $' are output you should expect to see.

$ pwd
/home/username
$ cd $SCRATCH                      # switch to your working space.
$ mkdir Rivers                      # create a directory to work in.
$ cd Rivers                         # move into your working directory.
$ module load python3 cuda gdal/2.2.1  # load python3, CUDA libraries and GDAL.
$ virtualenv rivers_env             # create a virtual environment to isolate your work from the default system.
$ source rivers_env/bin/activate    # activate your environment. Notice the command line prompt changes to show your environment on the next line.
[rivers_env] $ pwd
/pylon5/group/username/Rivers
[rivers_env] $ export PYTHONPATH=<path>/rivers_env/lib/python3.5/site-packages # set a system variable to point python to your specific code. (Replace <path> with the results of pwd command above.
[rivers_env] $ pip install iceberg_rivers.search # pip is a python tool to extract the requested software (iceberg_rivers.search in this case) from a repository. (this may take several minutes).

Method 2 (Installing from source; recommended for developers only):

$ git clone https://github.com/iceberg-project/Rivers.git
$ module load cuda
$ module load python3
$ virtualenv rivers_env
$ source rivers_env/bin/activate
[rivers_env] $ export PYTHONPATH=<path>/rivers_env/lib/python3.5/site-packages
[rivers_env] $ pip install . --upgrade

To test

[iceberg_rivers] $ deactivate       # exit your virtual environment.
$ interact -p GPU-small --gres=gpu:p100:1  # request a compute node.  This package has been tested on P100 GPUs on bridges, but that does not exclude any other resource that offers the same GPUs. (this may take a minute or two or more to receive an allocation).
$ cd $SCRATCH/Rivers                # make sure you are in the same directory where everything was set up before.
$ module load python3 cuda gdal/2.2.1  # load python3, CUDA libraries and GDAL, as before.
$ source rivers_env/bin/activate    # activate your environment, no need to create a new environment because the Rivers tools are installed and isolated here.
[iceberg_rivers] $ iceberg_rivers.tiling --help  # this will display a help screen of available usage and parameters.

Prediction

  • Download a pre-trained model at:

You can download to your local machine and use scp, ftp, rsync, or Globus to transfer to bridges.

Rivers predicting is executed in three steps: First, follow the environment setup commands under 'To test' above. Then create tiles from an input GeoTiff image and write to the output_folder. The scale_bands parameter (in pixels) depends on the trained model being used. The default scale_bands is 299 for the pre-trained model downloaded above. If you use your own model the scale_bands may be different.

[iceberg_rivers] $ iceberg_rivers.tiling --tile_size=224 --step=112 --input=<image_abspath> --output=./test/

Then, detect rivers on each tile and output counts and confidence for each tile.

[iceberg_rivers] $ iceberg_rivers.predict --input <tile_folder> -o <output_folder> -w <model>

Finally, mosaic all the tiles back into one image

[iceberg_rivers] $ iceberg_rivers.mosaic --input_WV image --input <masks_folder> --tile_size 224 --step 112 --output_folder ./mosaic

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

iceberg_rivers.search-0.1.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

iceberg_rivers.search-0.1-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file iceberg_rivers.search-0.1.tar.gz.

File metadata

  • Download URL: iceberg_rivers.search-0.1.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.2

File hashes

Hashes for iceberg_rivers.search-0.1.tar.gz
Algorithm Hash digest
SHA256 74f5286379d16b98276657689197518a129c2467609849683679a541bf4cd89d
MD5 6aa66f4a026d365f130052eb695a0dcb
BLAKE2b-256 6cdc5c7574d106c3b433a83f5272a3ebd09e33e41c6a0607fb90e9a5f53dfd43

See more details on using hashes here.

File details

Details for the file iceberg_rivers.search-0.1-py3-none-any.whl.

File metadata

  • Download URL: iceberg_rivers.search-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.5.2

File hashes

Hashes for iceberg_rivers.search-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2271a3e0801e117425123f47b9ff1026cb1f4f2d50e2ed74f5c93e5fbc1798cf
MD5 f80507a83226ab083978fe6efd7a57d4
BLAKE2b-256 b6d6ea1ca4dc21a9de409e2aae04a2309312f83d345d9739491b228aacfc41b4

See more details on using hashes here.

Supported by

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