We use the following 3rd party projects which are imported as git submodules. Please agree to their terms of use as well if you use this code.
- https://github.com/CSAILVision/semantic-segmentation-pytorch
- https://github.com/svip-lab/PlanarReconstruction
-
Download the pre-trained checkpoints for 'ade20k-hrnetv2-c1' available here. There are two checkpoint files 'encoder_epoch_30.pth' and 'decoder_epoch_30.pth'.
-
Download the pre-trained model for PlanarReconstruction provided by the authors.
-
Install pre-requisites of PlanarReconstruction and semantic-segmentation-pytorch projects to a common python environement. You can use the provided environment.yml file to create a conda environment that has dependencies of both projects.
conda env create -f environment.yml conda activate plane
-
Rename
./conf/data-paths-example.json
to./conf/data-paths.json
. Update checkpoint path fields of it. -
Extract rectified surface masks as follows.
export PYTHONPATH=./code/src python ./code/scripts/extract_surface_masks.py ./data/output/floor /path/to/rent3d/dataset/images/ floor python ./code/scripts/extract_surface_masks.py ./data/output/wall /path/to/rent3d/dataset/images/ wall python ./code/scripts/extract_surface_masks.py ./data/output/ceiling /path/to/rent3d/dataset/images/ ceiling
The rectified surface masks are generated at
./data/output/[SURFACE]/rectified_surface_masks
directory. You can open./data/output/[SURFACE]/index.html
to preview the extracted surface masks.cdcdcdcd