ICEBERG Rivers用例包
iceberg-rivers.search的Python项目详细描述
河流(北极水文)
提出了一种基于高分辨率图像的冰面特征分类算法。该算法通过卷积神经网络训练来识别大小河流区域,并将其与决口和非渠化淤泥区分开来。我们还提供了一种从已分类的高概率河流区域中提取折线水特征的检测算法。在
先决条件-所有这些都可以通过下面的命令在网桥上使用
- Linux系统
- Python3
- CPU和NVIDIA GPU+CUDA CuDNN
软件依赖项-这些将与下面的安装一起自动安装
- numpy公司
- 神经质的
- TIFF文件
- keras=1级
- tensorboardX==1.8
- opencv python
- 光栅
- 仿射的
- 皮格达尔==1.11.4.6
- 张量流
安装
准备工作:
这些指令特定于XSEDE网桥,但如果存在cuda、python3和NVIDIA P100 GPU,则可以使用其他资源,在这种情况下,可以跳过特定于网桥的“模块加载”指令。在
对于Unix或Mac用户:
使用Unix或Mac命令行终端通过ssh登录到网桥。可以直接或通过XSEDE门户登录网桥。请参阅Bridges User's Guide。在
对于Windows用户:
有许多工具可用于ssh访问网桥。请参见Ubuntu、MobaXterm或{a4}
PSC桥
一旦你登录到桥梁上,你可以遵循两种安装冰山河流的方法之一。在
方法1(推荐):
“$”后面的行是输入(或剪切和粘贴)到终端中的命令(请注意,所有命令都区分大小写,意味着大写字母和小写字母是有区别的。)“#”后面的所有内容都是注释,用于解释命令的原因,不应包含在输入的内容中。不以“$”或“[rivers\u env]$”开头的行是您应该看到的输出。在
$ 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] $ exportPYTHONPATH=<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).
方法2(从源代码安装;仅推荐给开发人员):
^{pr2}$测试
[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.
预测
- 下载预先培训的模型:
您可以下载到本地计算机并使用scp、ftp、rsync或Globus来transfer to bridges。在
河流预测分三步进行: 首先,按照上面“To test”下面的环境设置命令进行操作。然后从输入的GeoTiff图像创建平铺并写入output_文件夹。scale_bands参数(以像素为单位)取决于所使用的训练模型。对于上面下载的预先训练的模型,默认的scale_波段是299。如果您使用自己的模型,比例尺可能会有所不同。在
[iceberg_rivers] $ iceberg_rivers.tiling --tile_size=224 --step=112 --input=<image_abspath> --output=./test/
然后,检测每个瓦片上的河流,并为每个瓦片输出计数和置信度。在
[iceberg_rivers] $ iceberg_rivers.predict --input <tile_folder> -o <output_folder> -w <model>
最后,将所有瓷砖拼接成一幅图像
[iceberg_rivers] $ iceberg_rivers.mosaic --input_WV image --input <masks_folder> --tile_size 224 --step 112 --output_folder ./mosaic
- 项目
标签: