Coder Social home page Coder Social logo

sparseplanes's Introduction

Planar Surface Reconstruction From Sparse Views

Linyi Jin, Shengyi Qian, Andrew Owens, David F. Fouhey
University of Michigan
ICCV 2021 (Oral)


This repo contains code for our paper. Our model is implemented in Detectron2.

Given two RGB images with an unknown relationship, our system produces a single, coherent planar surface reconstruction of the scene in terms of 3D planes and relative camera poses.

model-architecture We use a ResNet50-FPN to detect planes and predict probabilities of relative camera poses, and use a two-step optimization to generate a coherent planar reconstruction. (a) For each plane, we predict a segmentation mask, plane parameters, and an appearance feature. (b) Concurrently, we pass image features from the detection backbone through the attention layer and predict the camera transformation between views. (c) Our discrete optimization fuses the prediction of the separate heads to select the best camera pose and plane correspondence. (d) Finally, we use continuous optimization to update the camera and plane parameters.

Usage Instructions

  1. How to setup your environment?
  2. How to inference the code on a pair of images?
  3. How to process the dataset?
  4. How to train your model?
  5. How to evaluate your model?

Citation

If you find this code useful, please consider citing:

@inproceedings{jin2021planar,
      title={Planar Surface Reconstruction from Sparse Views}, 
      author={Linyi Jin and Shengyi Qian and Andrew Owens and David F. Fouhey},
      booktitle = {ICCV},
      year={2021}
}

Acknowledgment

We thank Dandan Shan, Mohamed El Banani, Nilesh Kulkarni, Richard Higgins for helpful discussions. Toyota Research Institute ("TRI") provided funds to assist the authors with their research but this article solely reflects the opinions and conclusions of its authors and not TRI or any other Toyota entity.

sparseplanes's People

Contributors

jinlinyi avatar jasonqsy avatar

Stargazers

Song Mingtao avatar Liu JiaKang avatar  avatar Kush Sahni avatar Jeff Carpenter avatar Jiahui Zhang avatar  avatar Chris Rockwell avatar funkybirds avatar  avatar Chenyu avatar  avatar  avatar  avatar  avatar Fan Yang avatar  avatar Becmamba avatar Yunhao (Andy) Ge avatar  avatar  avatar Inhee Lee avatar smellslikeml avatar  avatar  avatar Olga Ivanova avatar Xixi Hu avatar  avatar Hang avatar Yuseung (Phillip) Lee avatar  avatar  avatar  avatar Samir Agarwala avatar Mingfang Zhang avatar  avatar  avatar  avatar Haiyan Wang avatar  avatar Mohamed El Banani avatar gzrer avatar Hannah Schieber avatar Robotics_Qi avatar Mihai Bujanca avatar  avatar 刘国庆, Guoqing Liu avatar  avatar Lei QIN avatar Xiaolong  avatar  avatar  avatar yaxu avatar huangyuan avatar Minjun Kang avatar Brian Pugh avatar Shuai wang avatar Matt Shaffer avatar Luchen Zhao avatar xuheny avatar  avatar Shengpu Tang avatar Roger GOU avatar Yuxuan Liu avatar Chenyang LEI avatar Cheng avatar Dandan Shan avatar Tong Wu avatar Jie Yang avatar 爱可可-爱生活 avatar Chao Wen avatar Faria Huq avatar Jiaming Sun avatar Shubham Tulsiani avatar Vikram Kalabi avatar  avatar  avatar tjnuwjm avatar Haotian-Zh avatar Nan Xue avatar  avatar  avatar  avatar  avatar Chong Hu avatar wudlxkq avatar Jingjia Shi avatar  avatar Yangming Wen avatar Chris Lesniewski avatar Tian Zheng avatar  avatar Zehong avatar Hengkai Guo avatar  avatar  avatar Yiming Xie avatar Haoyu Guo avatar daikiyamanaka avatar cheng zhang avatar

Watchers

James Cloos avatar cheng zhang avatar Andrew Owens avatar Jimmy Yu avatar 刘国友 avatar David Fouhey avatar  avatar  avatar Matt Shaffer avatar

sparseplanes's Issues

Custom dataset

"plane": # plane parameters
Can u explain hot to get "plane" - plane parameters from depth and segmentation maps ? maybe u have some utils.py ?

Testing on RTX3090

Dear respected authors,

let me first congrats you all on the great work!

I am trying to run your method On Linux Ubuntu 18.04, but I am facing the following problem:

/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/torch/cuda/init.py:125: UserWarning:
NVIDIA GeForce RTX 3090 Ti with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the NVIDIA GeForce RTX 3090 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))

I did some search and got to know that my RTX 3090 needs sm_86, which Cuda 10.1 doesn't support.
Therefore, I removed the virtual env and installed it again, this time with cuda 11.1. I tried installing it using Pip & Cuda as follows:

pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 torchaudio==0.10.1 -f https://download.pytorch.org/whl/cu111/torch_stable.html

conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

and chose the right detectron2 version from:

https://detectron2.readthedocs.io/en/latest/tutorials/install.html#install-pre-built-detectron2-linux-only

which is:

for torch1.1 (for pip option) :
python -m pip install detectron2 -f
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html

for torch1.8 (for conda option):
python -m pip install detectron2 -f
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html

When I tested with the Conda option, I got the following error:

Traceback (most recent call last):
File "tools/inference_sparse_plane.py", line 15, in
from pytorch3d.structures import join_meshes_as_batch
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/structures/init.py", line 4, in
from .pointclouds import Pointclouds
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/structures/pointclouds.py", line 5, in
from .. import ops
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/ops/init.py", line 5, in
from .graph_conv import GraphConv
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/ops/graph_conv.py", line 8, in
from pytorch3d import _C
ImportError: libcudart.so.10.1: cannot open shared object file: No such file or directory

When I tested with Pip option, I got the following error:

Traceback (most recent call last):
File "tools/inference_sparse_plane.py", line 15, in
from pytorch3d.structures import join_meshes_as_batch
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/structures/init.py", line 4, in
from .pointclouds import Pointclouds
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/structures/pointclouds.py", line 5, in
from .. import ops
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/ops/init.py", line 5, in
from .graph_conv import GraphConv
File "/home/desk/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/ops/graph_conv.py", line 8, in
from pytorch3d import _C
ImportError: libcudart.so.10.1: cannot open shared object file: No such file or directory

After some research, I got to know that these errors have to do with cuda10.1, which I can't use for the reasons mentioned earlier.

Do you have any recommendations or directions to follow to solve this problem?

Thank you in advance for your guidance.

ValueError: Textures do not match the dimensions of Meshes.

Hi,
Thanks for your great job.
After running "python ./tools/inference_sparse_plane.py --config-file ./tools/demo/config.yaml --input ./tools/demo/teaser --output ./debug", I met an error as follows, do you know what caused it and how to solve it?
Traceback (most recent call last):
File "./tools/inference_sparse_plane.py", line 766, in
main()
File "./tools/inference_sparse_plane.py", line 762, in main
inference_pair(output_dir, model, dis_opt, con_opt, im0, im1)
File "./tools/inference_sparse_plane.py", line 727, in inference_pair
webvis=True,
File "./tools/inference_sparse_plane.py", line 627, in save_pair_objects
cam_meshes = get_camera_meshes(cam_list)
File "/home/jia/workspace/plane_resc_210617/SparsePlanes/sparsePlane/sparseplane/utils/mesh_utils.py", line 378, in get_camera_meshes
meshes = Meshes(verts=verts_list, faces=faces_list, textures=tex)
File "/home/jia/anaconda3/envs/sparseplane/lib/python3.7/site-packages/pytorch3d/structures/meshes.py", line 436, in init
raise ValueError(msg)
ValueError: Textures do not match the dimensions of Meshes.
Screenshot from 2021-09-08 14-11-52

Dataset download links seem extremely slow

Hi, thanks for sharing this amazing work!

The dataset download link are extremely slow for me. I tried on multiple networks.

Is there an alternative link to download the dataset?

Thanks,
Pushkar

Matterport extrinsics not accurate

I generated the cam2cam extrinsics of Matterport using the provided camera pose (camera.zip), which is not accurate, did someone also encounter this problem?

Looking forward to the evaluation code.

Hi,
Great work!
Hope to see the evaluation code soon.
I have some confusion about the evaluation process for the final results. Although I find some metric codes in the project, it seems that they are used for validation.
Best.

Depth zip download error

OneDrive keeps throwing an error when downloading about 75%.
Could you please verify whether the error is on my end or on the server's end ?
Thank you

image

how many images I can input ?

Hello nice job)
Have you tested this on more than two images ?
--img-list /path/to/img_list.txt \

img_list.txt:

img1.png
img2.png
img3.png
......
what about structure img_list.txt

Can I add 3 or 10 images ?

Training details

Hi,thanks for your great work!

I home some trouble for training the network on step1(the detect plane stage) because I am not sure when to stop! I am training the network on Scannet dataset using your pre-trained model,and my loss is continuing to decline slowly during 40k iteration.
Could you give me some advice?Thank you!
2022-03-12 16-27-06 的屏幕截图

requirements

No module named 'KMSolver'
No module named 'seaborn'
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
u need uninstall numpy 1.19.2 and change to pip install numpy==1.20.0 and
no problem install seaborn

How to install KMSolver ????

windows or linux?

the whole project is under windows or linux?
how can i make it with windows?

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.