plankassembly

[ICCV 2023] PlankAssembly: Robust 3D Reconstruction from Three Orthographic Views with Learnt Shape Programs

https://github.com/manycore-research/plankassembly

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.4%) to scientific vocabulary

Keywords

3d-modeling 3d-reconstruction computer-vision deep-learning engineering-drawing pytorch transformer
Last synced: 9 months ago · JSON representation ·

Repository

[ICCV 2023] PlankAssembly: Robust 3D Reconstruction from Three Orthographic Views with Learnt Shape Programs

Basic Info
Statistics
  • Stars: 79
  • Watchers: 3
  • Forks: 9
  • Open Issues: 0
  • Releases: 0
Topics
3d-modeling 3d-reconstruction computer-vision deep-learning engineering-drawing pytorch transformer
Created almost 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

# PlankAssembly: Robust 3D Reconstruction from Three Orthographic Views with Learnt Shape Programs

Wentao Hu* · Jia Zheng* · Zixin Zhang* · Xiaojun Yuan · Jian Yin · Zihan Zhou

IEEE/CVF Conference on Computer Vision (ICCV), 2023

*These authors contributed equally to this work.
[![arXiv](http://img.shields.io/badge/arXiv-2308.05744-B31B1B.svg)](https://arxiv.org/abs/2308.05744) [![Conference](https://img.shields.io/badge/ICCV-2023-4b44ce.svg)](https://openaccess.thecvf.com/content/ICCV2023/html/Hu_PlankAssembly_Robust_3D_Reconstruction_from_Three_Orthographic_Views_with_Learnt_ICCV_2023_paper.html)

[!NOTE] In our follow-up work, CAD2Program, we discovered that a modern vision models (e.g., ViT) can understand engineering drawings. For detailed implementation, please check vit branch.

[!NOTE] This branch contains the implementation of PlankAssembly, which supports three types of inputs: (1) visible and hidden lines, (2) visible edges only, and (3) sidefaces. For raster images as inputs, please refer to the raster branch. For comparison with PolyGen, please refer to the polygen branch.

Setup

Our code has been tested with Python 3.8, PyTorch 1.10.0, CUDA 11.3, and PyTorch Lightning 1.7.6.

Installation

Clone the repository, then create and activate a plankassembly conda environment using the following commands.

```bash

clone repository

git clone https://github.com/manycore-research/PlankAssembly.git

create conda env

conda env create --file environment.yml conda activate plankassembly ```

If you encounter any issue with provided conda environment, you may install dependencies manually using the following commands. ```bash conda create -n plankassembly python=3.8 conda activate plankassembly conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge pip install pytorch-lightning==1.7.7 torchmetrics==0.11.4 rich==12.5.1 'jsonargparse[signatures]' pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/detectron2-0.6%2Bcu113-cp38-cp38-linux_x86_64.whl conda install -c conda-forge pythonocc-core=7.6.2 pip install numpy shapely svgwrite svgpathtools trimesh setuptools==59.5.0 html4vision ```

Dataset

The dataset can be found on Hugging Face Datasets. Please download the data first, then unzip the data in the project workspace.

The released dataset only contains 3D shape programs. To prepare the data for training and testing, please run the following commands.

We use PythonOCC to render three-view orthogonal engineering drawings and save them as SVG files.

```bash

render complete inputs

python dataset/rendercompletesvg.py

render noisy inputs, please specify the noise ratio

python dataset/rendernoisysvg.py --datatype noise05 --noise_ratio 0.05

render visible inputs

python dataset/rendervisiblesvg.py ```

Then, pack the input line drawings and output shape programs into JSON files.

bash python dataset/prepare_info.py --data_path path/to/data/root

To visualize the 3D model, we could generate the ground-truth 3D meshes from shape.

bash python misc/build_gt_mesh.py --data_path path/to/data/root

Training

Use the following command to train a model from scratch:

```bash

train a model with complete lines as inputs

python trainercomplete.py fit --config configs/traincomplete.yaml ```

Testing

Use the following command to test with a pre-trained model:

```bash

infer a model with complete lines as inputs

python trainercomplete.py test \ --config configs/traincomplete.yaml \ --ckpt_path path/to/checkpoint.ckpt \ --trainer.devices 1 ```

Evaluation

To compute the evaluation metrics, please run the following command:

bash python evaluate.py --data_path path/to/data/dir --exp_path path/to/lightning_log/dir

Visualization

To visualize the results, we build 3D mesh models from predictions:

bash python misc/build_pred_mesh.py --exp_path path/to/lightning_log/dir

Then, we use HTML4Vision to generate HTML files for mesh visualization (please refer to here for more details):

bash python misc/build_html.py --exp_path path/to/lightning_log/dir

The 2D images presented in our paper are rendered using bpy-visualization-utils.

Model Checkpoints

The checkpoints can be found on Hugging Face Models. Or click the links below to download the checkpoint for the corresponding model type directly.

  • Model trained on complete inputs: here
  • Model trained on visible inputs only: here
  • Model trained on sideface inputs: here

LICENSE

PlankAssembly is licensed under the AGPL-3.0 license. The code snippets in the third_party folder are available under Apache-2.0 License.

Owner

  • Name: Manycore Research Institute
  • Login: manycore-research
  • Kind: organization
  • Location: Hangzhou, China

Manycore Tech Inc.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
preferred-citation:
  type: conference-paper
  collection-type: proceedings
  title: "PlankAssembly: Robust 3D Reconstruction from Three Orthographic Views with Learnt Shape Programs"
  authors:
    - family-names: Hu
      given-names: Wentao
    - family-names: Zheng
      given-names: Jia
    - family-names: Zhang
      given-names: Zixin
    - family-names: Yuan
      given-names: Xiaojun
    - family-names: Yin
      given-names: Jian
    - family-names: Zhou
      given-names: Zihan
  collection-title: "Proceedings of IEEE/CVF Conference on Computer Vision (ICCV)"
  year: 2023

GitHub Events

Total
  • Issues event: 4
  • Watch event: 22
  • Issue comment event: 9
  • Push event: 3
  • Fork event: 5
  • Create event: 1
Last Year
  • Issues event: 4
  • Watch event: 22
  • Issue comment event: 9
  • Push event: 3
  • Fork event: 5
  • Create event: 1

Issues and Pull Requests

Last synced: about 2 years ago

All Time
  • Total issues: 8
  • Total pull requests: 1
  • Average time to close issues: 7 days
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 4.38
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 8
  • Pull requests: 1
  • Average time to close issues: 7 days
  • Average time to close pull requests: about 7 hours
  • Issue authors: 5
  • Pull request authors: 1
  • Average comments per issue: 4.38
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • guist (3)
  • thanhdat77 (2)
  • SanketDhuri (2)
  • raushanagrawal (1)
  • lw0210 (1)
Pull Request Authors
  • eltociear (1)
  • longbowzhang (1)
Top Labels
Issue Labels
question (3) bug (1)
Pull Request Labels

Dependencies

environment.yml conda
  • _libgcc_mutex 0.1.*
  • _openmp_mutex 4.5.*
  • blas 1.0.*
  • bzip2 1.0.8.*
  • c-ares 1.19.1.*
  • ca-certificates 2023.7.22.*
  • cudatoolkit 11.3.1.*
  • curl 7.87.0.*
  • double-conversion 3.2.0.*
  • eigen 3.4.0.*
  • expat 2.5.0.*
  • ffmpeg 4.3.2.*
  • font-ttf-dejavu-sans-mono 2.37.*
  • font-ttf-inconsolata 3.000.*
  • font-ttf-source-code-pro 2.038.*
  • font-ttf-ubuntu 0.83.*
  • fontconfig 2.14.0.*
  • fonts-conda-ecosystem 1.*
  • fonts-conda-forge 1.*
  • freeimage 3.18.0.*
  • freetype 2.10.4.*
  • gl2ps 1.4.2.*
  • gmp 6.2.1.*
  • gnutls 3.6.13.*
  • hdf4 4.2.15.*
  • hdf5 1.12.1.*
  • icu 72.1.*
  • intel-openmp 2021.4.0.*
  • jpeg 9e.*
  • jsoncpp 1.9.5.*
  • keyutils 1.6.1.*
  • krb5 1.20.1.*
  • lame 3.100.*
  • lcms2 2.12.*
  • ld_impl_linux-64 2.40.*
  • lerc 3.0.*
  • libcurl 7.87.0.*
  • libdeflate 1.10.*
  • libedit 3.1.20221030.*
  • libev 4.33.*
  • libexpat 2.5.0.*
  • libffi 3.2.1.*
  • libgcc-ng 13.1.0.*
  • libgfortran-ng 13.1.0.*
  • libgfortran5 13.1.0.*
  • libgomp 13.1.0.*
  • libhwloc 2.9.1.*
  • libiconv 1.17.*
  • libnetcdf 4.8.1.*
  • libnghttp2 1.51.0.*
  • libogg 1.3.4.*
  • libpng 1.6.37.*
  • libsqlite 3.42.0.*
  • libssh2 1.10.0.*
  • libstdcxx-ng 13.1.0.*
  • libtheora 1.1.1.*
  • libtiff 4.3.0.*
  • libuuid 2.38.1.*
  • libuv 1.43.0.*
  • libvorbis 1.3.7.*
  • libwebp-base 1.2.2.*
  • libxcb 1.15.*
  • libxml2 2.10.4.*
  • libzip 1.9.2.*
  • libzlib 1.2.13.*
  • loguru 0.7.0.*
  • lz4-c 1.9.3.*
  • mkl 2021.4.0.*
  • mkl-service 2.4.0.*
  • mkl_fft 1.3.1.*
  • mkl_random 1.2.2.*
  • ncurses 6.4.*
  • nettle 3.6.*
  • numpy 1.24.3.*
  • numpy-base 1.24.3.*
  • occt 7.6.2.*
  • olefile 0.46.*
  • openh264 2.1.1.*
  • openjpeg 2.4.0.*
  • openssl 1.1.1v.*
  • pillow 8.2.0.*
  • pip 23.2.1.*
  • proj 9.0.0.*
  • pthread-stubs 0.4.*
  • pugixml 1.11.4.*
  • python 3.8.0.*
  • python_abi 3.8.*
  • pythonocc-core 7.6.2.*
  • pytorch 1.10.0.*
  • pytorch-mutex 1.0.*
  • rapidjson 1.1.0.*
  • readline 8.2.*
  • six 1.16.0.*
  • sqlite 3.42.0.*
  • svgwrite 1.4.3.*
  • tbb 2021.9.0.*
  • tbb-devel 2021.9.0.*
  • tk 8.6.12.*
  • torchaudio 0.10.0.*
  • torchvision 0.11.0.*
  • typing_extensions 4.7.1.*
  • utfcpp 3.2.4.*
  • vtk 9.1.0.*
  • wheel 0.38.4.*
  • x264 1!161.3030.*
  • xorg-kbproto 1.0.7.*
  • xorg-libice 1.1.1.*
  • xorg-libsm 1.2.4.*
  • xorg-libx11 1.8.6.*
  • xorg-libxau 1.0.11.*
  • xorg-libxdmcp 1.1.3.*
  • xorg-libxt 1.3.0.*
  • xorg-xextproto 7.3.0.*
  • xorg-xproto 7.0.31.*
  • xz 5.2.6.*
  • zlib 1.2.13.*
  • zstd 1.5.2.*