This is an official PyTorch implementation for paper "V-FloodNet: A Video Segmentation System for Urban Flood Detection and Quantification".
We developed and tested the source code under Ubuntu 18.04 and PyTorch framework. The following packages are required to run the code.
First, a python virtual environment is recommended.
I use pip
to create a virtual environment named env
and activate it.
python3 -m venv env
source env/bin/activate
In the virtual environment, install the following required packages from their official instructions.
- torch, torchvision, from PyTorch. We used v1.8.2+cu111 is used in our code.
- Detectron2 for reference objects segmentation.
- MeshTransformer for
We provide the corresponding installation command here
pip install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
python3 test_image_seg.py \
--test_path=/path/to/image_folder \
--test_name=<test_name>
python3 est_waterlevel.py \
--test_name=stopsign \
--img_dir=/path/to/image_folder \
--water_mask_dir=./output/test_image_seg/<test_name>/mask
--opt=stopsign
python3 est_waterlevel.py \
--test_name=skeleton \
--img_dir=/path/to/image_folder \
--water_mask_dir=./output/test_image_seg/<test_name>/mask
--opt=skeleton