This is code for applyging deeplabv3+ to glacier front delineation. the code include pre-processing, network-training, and post-processing. The Deeplab3+ codes are based on https://github.com/jfzhang95/pytorch-deeplab-xception.
git clone https://github.com/enzezhang/Front_DL3.git
cd Front_DL3
https://www.anaconda.com/products/individual#linux
bash Anaconda3-2021.05-Linux-x86_64.sh
conda create -n py3.6 python=3.6
conda activate py3.6
gdal_contrast_stretch (for normalizing the histogram) https://github.com/gina-alaska/dans-gdal-scripts
conda install gdal
There could be some library issues.
pip install matplotlib pillow tensorboardX tqdm torch torchvision
pip install Shapely pyshp pyproj rasterio
conda install -c conda-forge gmt
In the file para.ini, the user need to set working_root to ${User_dir}/Front_DL3, and code dir to ${User_dir}/Front_DL3/script.
Also need to set the patch size and the data_path.
vi para.in
working_root =~/Front_DL3 (this is where you put Front_DL3 codes)
data_path=~/greenland (this is the path of data files, it contains all the images of Greenland glaciers)
codes_dir =~/Front_DL3/script #(for script folder within Front_DL3)
the CUDA version should be higher than 10.1.
Do not untar it.
bash preparing_traindata.sh
This code will generate list/train_aug.txt that shows the training image and corresponding ground truth image (the file names of these two images are identical).
bash exe.sh
bash preparing_influence.sh ${User_dir}/Front_DL3/train
bash exe_inference.sh ${User_dir}/Front_DL3/polygon/cut_polygon.gmt drn_Jan28_2021_single_0.01_aug_momentum_0.9_from_stretch_16_batch_size.tar
need to use the full path