DeepPanoContext
πΈοΈ [ICCV'21 Oral] Official PyTorch code of DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context Graph and Relation-based Optimization
Install / Use
/learn @chengzhag/DeepPanoContextREADME
DeepPanoContext (DPC) [Project Page (with interactive results)][Paper][Video]
DeepPanoContext: Panoramic 3D Scene Understanding with Holistic Scene Context Graph and Relation-based Optimization
Cheng Zhang, Zhaopeng Cui, Cai Chen, Shuaicheng Liu, Bing Zeng, Hujun Bao, Yinda Zhang

Introduction
This repo contains data generation, data preprocessing, training, testing, evaluation, visualization code of our ICCV 2021 paper.
Install
Install necessary tools and create conda environment (needs to install anaconda if not available):
sudo apt install xvfb ninja-build freeglut3-dev libglew-dev meshlab
conda env create -f environment.yaml
conda activate Pano3D
pip install wandb
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.7/index.html
python project.py build
- When running
python project.py build, the script will runexternal/build_gaps.shwhich requires password for sudo privilege forapt-get install. Please make sure you are running with a user with sudo privilege. If not, please reach your administrator for installation of these libraries and comment out the corresponding lines then runpython project.py build. - If you encounter
/usr/bin/ld: cannot find -lGLproblem when building GAPS, please follow this issue.
Since the dataloader loads large number of variables,
before training, please follow this to raise the open file descriptor limits of your system.
For example, to permanently change the setting, edit /etc/security/limits.conf with a text editor and add the following lines:
* hard nofile 500000
* soft nofile 500000
root hard nofile 500000
root soft nofile 500000
Demo
Download the pretrained checkpoints
of detector, layout estimation network, and other modules.
Then unzip the folder out into the root directory of current project.
Since the given checkpoints are trained with current version of our code, which is a refactored version, the results are slightly better than those reported in our paper.
Please run the following command to predict on the given example in demo/input with our full model:
CUDA_VISIBLE_DEVICES=0 WANDB_MODE=dryrun python main.py configs/pano3d_igibson.yaml --model.scene_gcn.relation_adjust True --mode test
Or run without relation optimization:
CUDA_VISIBLE_DEVICES=0 WANDB_MODE=dryrun python main.py configs/pano3d_igibson.yaml --mode test
The results will be saved to out/pano3d/<demo_id>.
If nothing goes wrong, you should get the following results:
<img src="demo/output/rgb.png" alt="rgb.png" width="45%" /> <img src="demo/output/visual.png" alt="visual.png" width="45%" /> <br> <img src="demo/output/det3d.png" alt="det3d.jpg" width="45%" /> <img src="demo/output/render.png" alt="render.png" width="45%" />
Data preparation
Our data is rendered with iGibson.
Deprecated - Here, we follow their Installation guide to download iGibson dataset, then render and preprocess the data with our code.
Update - Since iGibson has gone through a major update, their dataset download link has been updated. Please download the dataset here and follow the README to put the dataset into right places.
-
Download iGibson dataset with:
python -m gibson2.utils.assets_utils --download_ig_dataset -
Render panorama with:
python -m utils.render_igibson_scenes --renders 10 --random_yaw --random_obj --horizon_lo --world_loThe rendered dataset should be in
data/igibson/. -
Make models watertight and render/crop single object image:
python -m utils.preprocess_igibson_obj --skip_mgnThe processed results should be in
data/igibson_obj/. -
(Optional) Before proceeding to the training steps, you could visualize dataset ground-truth of
data/igibson/with:python -m utils.visualize_igibsonResults ('visual.png' and 'render.png') should be saved to folder of each camera like
data/igibson/Pomaria_0_int/00007.
Training and Testing
Preparation
-
We use the pretrained weights of Implicit3DUnderstanding for fine-tuning Bdb3d Estimation Network (BEN) and LIEN+LDIF. Please download the pretrained checkpoint and unzip it into
out/total3d/20110611514267/. -
We use wandb for logging and visualizing experiments. You can follow their quickstart guide to sign up for a free account and login on your machine with
wandb login. The training and testing results will be uploaded to your project "deeppanocontext". -
Hint: The <XXX_id> in the commands bellow needs to be replaced with the XXX_id trained in the previous steps.
-
Hint: In the steps bellow, when training or testing with main.py, you can override yaml configurations with command line parameter:
CUDA_VISIBLE_DEVICES=0 python main.py configs/layout_estimation_igibson.yaml --train.epochs 100This might be helpful when debugging or tuning hyper-parameters.
First Stage
2D Detector
Please follow Demo section to download weights for detector before we release full fine-tuning code for detector.
Layout Estimation
Train layout estimation network (HorizonNet) with:
CUDA_VISIBLE_DEVICES=0 python main.py configs/layout_estimation_igibson.yaml
The checkpoint and visualization results will be saved to out/layout_estimation/<layout_estimation_id>/model_best.pth
Save First Stage Outputs
-
Save predictions of 2D detector and LEN as dateset for stage 2 training:
CUDA_VISIBLE_DEVICES=0 WANDB_MODE=dryrun python main.py configs/first_stage_igibson.yaml --mode qtest --weight out/layout_estimation/<layout_estimation_id>/model_best.pthThe first stage outputs should be saved to
data/igibson_stage1 -
(Optional) Visualize stage 1 dataset with:
python -m utils.visualize_igibson --dataset data/igibson_stage1 --skip_render
Second Stage
Object Reconstruction
Train object reconstruction network (LIEN+LDIF) with:
CUDA_VISIBLE_DEVICES=0 python main.py configs/ldif_igibson.yaml
The checkpoint and visualization results will be saved to out/ldif/<ldif_id>.
Bdb3D Estimation
Train bdb3d estimation network (BEN) with:
CUDA_VISIBLE_DEVICES=0 python main.py configs/bdb3d_estimation_igibson.yaml
The checkpoint and visualization results will be saved to out/bdb3d_estimation/<bdb3d_estimation_id>.
Relation SGCN
-
Train Relation SGCN without relation branch:
CUDA_VISIBLE_DEVICES=0 python main.py configs/relation_scene_gcn_igibson.yaml --model.scene_gcn.output_relation False --model.scene_gcn.loss BaseLoss --weight out/bdb3d_estimation/<bdb3d_estimation_id>/model_best.pth out/ldif/<ldif_id>/model_best.pthThe checkpoint and visualization results will be saved to
out/relation_scene_gcn/<relation_sgcn_wo_rel_id>. -
Train Relation SGCN with relation branch:
CUDA_VISIBLE_DEVICES=0 python main.py configs/relation_scene_gcn_igibson.yaml --weight out/relation_scene_gcn/<relation_sgcn_wo_rel_id>/model_best.pth --train.epochs 20The checkpoint and visualization results will be saved to
out/relation_scene_gcn/<relation_sgcn_id>. -
Fine-tune Relation SGCN end-to-end with relation optimization:
CUDA_VISIBLE_DEVICES=0 python main.py configs/relation_scene_gcn_igibson.yaml --weight out/relation_scene_gcn/<relation_sgcn_id>/model_best.pth --model.scene_gcn.relation_adjust True --train.batch_size 1 --val.batch_size 1 --device.num_workers 2 --train.freeze shape_encoder shape_decoder --model.scene_gcn.loss_weights.bdb3d_proj 1.0 --model.scene_gcn.optimize_steps 20 --train.epochs 10The checkpoint and visualization results will be saved to
out/relation_scene_gcn/<relation_sgcn_ro_id>.
Test Full Model
Run:
CUDA_VISIBLE_DEVICES=0 python main.py configs/relation_scene_gcn_igibson.yaml --weight out/relation_scene_gcn/<relation_sgcn_ro_id>/model_best.pth --log.path out/relation_scene_gcn --resume False --finetune True --model.scene_gcn.relation_adjust True --mode qtest --model.scene_gcn.optimize_steps 100
The visualization results will be saved to out/relation_scene_gcn/<relation_sgcn_ro_test_id>.
Citation
If you find our work and code helpful, please consider cite:
@inproceedings{zhang2021deeppanocontext,
title={DeepPanoContext: Panoramic 3D Scene Understanding With Holistic Scene Context Graph and Relation-Based Optimization},
author={Zhang, Cheng and Cui, Zhaopeng and Chen, Cai and Liu, Shuaicheng and Zeng, Bing and Bao, Hujun and Zhan
Related Skills
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
isf-agent
a repo for an agent that helps researchers apply for isf funding
last30days-skill
17.2kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
