Coder Social home page Coder Social logo

davidgillsjo / bssc-net Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 1.0 2.21 MB

This is a PyTorch implementation of a Bayesian Convolutional Neural Network (BCNN) for Semantic Scene Completion on the SUNCG dataset. Given a depth image the network outputs a semantic segmentation and entropy score in 3D voxel format.

License: MIT License

Dockerfile 1.68% Shell 5.90% Python 92.42%
cnn bayesian-neural-network semantic-segmentation semantic-scene-completion deep-neural-networks deep-learning

bssc-net's Introduction

BSSC-Net

CNN for Bayesian Semantic Scene Completion from a single depth image. This is the code release for our paper from ICPR2020. Preprint is also available at ArXiV.

Image of BSSC-Net

Introduction

This is a PyTorch implementation of a Bayesian Convolutional Neural Network (BCNN) for Semantic Scene Completion on the SUNCG dataset. Given a depth image represented as inverted depth (see code) the network outputs a semantic segmentation and entropy score in 3D voxel format.

Setup repository

git clone [email protected]:DavidGillsjo/bssc-net.git --recurse-submodules -j8

Using the docker images

Check your Nvidia GPU model and adjust the variable gpu_arch accordingly in docker/<module>/Dockerfile.

With elevated docker group permissions:

cd docker/<module>
./build.sh
./run.sh

Without:

cd docker/<module>
sudo DUSER=<username> ./build.sh
sudo DHOME=/home/<username> ./run.sh

Render and Build Dataset

Download SUNCG dataset

Download camera viewpoints:

wget http://pbrs.cs.princeton.edu/pbrs_release/data/camera_v2.zip
unzip camera_v2.zip -d ../camera

Build and run the suncg_house3d docker in the docker folder, see section Using the docker images. Alternatively install the dependencies yourself, see the Dockerfile.

Go to repo root from docker:

cd /host_home/<your-repo-path>

the following code snippets assume your are in this directory.

Build SUNCG Toolbox:

cd libs/SUNCGtoolbox/gaps
make clean
make

Build House3d:

cd libs/House3D/renderer
PYTHON_CONFIG=python3-config make -j

Set python path:

. init_env.sh

Execute rendering and grid generation script:

cd preprocessing
python3 generate_grids.py <suncg_dir> --nbr-proc 8 --model-blacklist blacklists/default.yaml --datasets <data_split_dir>/*mini.json

This will store results in <suncg_dir>/scene_comp, for more details see python3 generate_grids.py --help. JSON dataset files are generated with preprocessing/generate_data_splits.py. The splits used in the article can be found here.

Prerequisites for training/evaluating networks

Build and run the bssc docker in the docker folder, see section Using the docker images. Alternatively install the dependencies yourself, see the Dockerfile.

Train network

Depth images with corresponding voxel ground truth generated in previous section is required. For example placed in /host_home/<suncg_dir>/scene_comp.

Training can be monitored with tensorboard, for this you need to run:

cd ssc/scripts
./start_tensorboard.sh &

To start training, run:

cd ssc/scripts
python3 train.py /host_home/<suncg_dir>/scene_comp <train_json> --cfg ../cfg/train_bayesian.yaml --val <val_json>

See configs for options.

Evaluate example image

To run the example, first download the pre-trained weights from here. Then run the evaluation script:

cd ssc/scripts
python3 eval.py ../../example ../../example/dataset.json bssc.tar --cfg ../cfg/eval_bayesian.yaml --result-dir <my_result_path>

For the SSC style net or run the following for Unet implementation:

cd ssc/scripts
python3 eval.py ../../example ../../example/dataset.json bssc_unet.tar --cfg ../cfg/eval_bayesian_unet.yaml --result-dir <my_result_path>

Citation

@INPROCEEDINGS{bssc_net,
  author={Gillsjö, David and Åström, Kalle},
  booktitle={2020 25th International Conference on Pattern Recognition (ICPR)}, 
  title={In Depth Bayesian Semantic Scene Completion}, 
  year={2021},
  volume={},
  number={},
  pages={6335-6342},
  doi={10.1109/ICPR48806.2021.9412403}}

Acknowledgment

This work is supported by Wallenberg AI Autonomous Systems and Software Program.

bssc-net's People

Contributors

davidgillsjo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

qianqian121

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.