Giter Site home page Giter Site logo

chriswu1997 / deepcad Goto Github PK

View Code? Open in Web Editor NEW
227.0 227.0 42.0 263 KB

code for our ICCV 2021 paper "DeepCAD: A Deep Generative Network for Computer-Aided Design Models"

Home Page: http://www.cs.columbia.edu/cg/deepcad/

License: MIT License

Python 99.94% Shell 0.06%
3d-shapes computer-aided-design computer-graphics deep-learning iccv2021 paper

deepcad's People

Contributors

chriswu1997 avatar dependabot[bot] avatar tosemml avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepcad's Issues

python show.py --src ../data/data --from h5

Traceback (most recent call last):
File "D:\DeepCAD-master\utils\show.py", line 6, in
from OCC.Display.SimpleGui import init_display
ModuleNotFoundError: No module named 'OCC'

Some arcs may have incorrect reference vector

Hi DeepCAD Team,

I'm plotting some parts of your data and I believe in some cases the definition of Arc3D may be incorrect. For example I am analyzing json file 00057168.json sketch Fr8CL4J6BeRGSeU_3 profile JSa.
00057168_Fr8CL4J6BeRGSeU_3_JSa
Looking at this file in the ABC dataset I see
image
I think the profile in question came from the yellow shape.

My understanding of the dataset is that the reference vector can be used to understand which segment of the circle forms the arc. The reference vector is a 2D vector in the sketch plane coordinate system. The visible segment of the arc is anti-clockwise from the reference vector. The sweep angle is defined by end_angle. For the top arc in the 2D image at the start of this post we have

        {
         "center_point": {
          "y": -0.20581618,
          "x": -0.07702744,
          "z": 0.0
         },
         "start_point": {
          "y": -0.18829072,
          "x": -0.04397157,
          "z": 0.0
         },
         "start_angle": 0.0,
         "end_point": {
          "y": -0.16869228,
          "x": -0.0816803,
          "z": 0.0
         },
         "normal": {
          "y": 0.0,
          "x": 0.0,
          "z": 1.0
         },
         "curve": "JSF",
         "end_angle": 5.07520255726804,
         "radius": 0.03741434,
         "type": "Arc3D",
         "reference_vector": {
          "y": 0.9922371231467976,
          "x": -0.12436032908193387,
          "z": 0.0
         }
        }

So the sweep angle is bigger than pi and the large half of the arc is incorrectly chosen.

Do you have any strategy for determining the correct segment of the arc?

Thank you for your help.

json2pc.py meets SIGSEGV

Hi Chris.

Greetings.

DeepCAD is a really inspiring work and has shed light on future research such as parametric modeling. The results are promising and the code is clear.

However, every time when I tried to run json2pc.py, I always meet SIGSEGV halfway. The reported error is like

`
joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

The exit codes of the workers are {SIGSEGV(-11)}
`

I'm using ubuntu 20.04.3, with python 3.7.11 and pythonocc-core 7.5.1. I don't know whether it is the error my environment or something related to the raw CAD json data and I have little idea to debug.

Have you ever met this issue? If so, how did you fix it?

Thanks a lot.

Regarding Point Cloud Reconstruction

Hello ,

Apologies as my question is not purely related to DeepCAD, but is of extreme importance to me.

Would it be possible to know what software or library you used to carry out point cloud reconstruction as shown in Figure 6 of the paper?

I would really appreciate this info.

Thank you again, and truly amazing work!

CUBLAS_STATUS_EXECUTION_FAILED and .h5 file not found

Hello! I'm interested in this research and would like to try running it myself.
I have referred to a solution for this issue, but it seems to be slightly different.
After I finished json2pc.py and get all training / testing point clouds. (except INVALID_IDS)
When I run pc2cad.py, I got the following error message:
unable to open file: name = 'proj_log/pretrained/results/all_zs_ckpt1000.h5'
Where I can get this file?

In the other hand, When I run test.py , I got the following error message:
python test.py --exp_name pretrained --mode rec --ckpt 1000 -g 0
----Experiment Configuration-----
proj_dir proj_log
data_root data
exp_name pretrained
gpu_ids 0
batch_size 512
num_workers 8
nr_epochs 1000
lr 0.001
grad_clip 1.0
warmup_step 2000
cont False
ckpt 1000
vis False
save_frequency 500
val_frequency 10
vis_frequency 2000
augment False
mode rec
outputs None
z_path None
Loading checkpoint from proj_log/pretrained/model/ckpt_epoch1000.pth ...
Total number of test data: 16
0%| | 0/16 [00:00<?, ?it/s]Traceback (most recent call last):
File "test.py", line 130, in
main()
File "test.py", line 18, in main
reconstruct(cfg)
File "test.py", line 52, in reconstruct
outputs, _ = tr_agent.forward(data)
File "/home/joehsu/DeepCAD/trainer/trainerAE.py", line 27, in forward
outputs = self.net(commands, args)
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/joehsu/DeepCAD/model/autoencoder.py", line 154, in forward
z = self.encoder(commands_enc_, args_enc_)
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/joehsu/DeepCAD/model/autoencoder.py", line 74, in forward
src = self.embedding(commands, args, group_mask)
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/joehsu/DeepCAD/model/autoencoder.py", line 32, in forward
self.embed_fcn(self.arg_embed((args + 1).long()).view(S, N, -1)) # shift due to -1 PAD_VAL
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 87, in forward
return F.linear(input, self.weight, self.bias)
File "/home/joehsu/miniconda3/envs/deepcad/lib/python3.7/site-packages/torch/nn/functional.py", line 1612, in linear
output = input.matmul(weight.t())
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)

other info :

NVIDIA GeForce RTX 3080 Ti
CUDA Version: 11.7
Ubuntu 20.04.6 LTS
Pytorch = 1.5.1
Python = 3.7

About STEP format

Thanks for your greak work!

I'm curious about that the parser can parse any STEP format file into the Fusion 360 dataset format?

Many thanks.

Cannot find dataset of STEP models

My friend and I are interested in reimplementing your work. We are able to find the JSON data containing command sequences on this github page but have trouble finding the STEP model data.

Is there any possible ways we can access the STEP model data? Thank you so much!

RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

thank you for sharing pc2cad.py,when I run the code:

python pc2cad.py --exp_name pretrained --ae_ckpt 1000 -g 0 --pc_root /public1/tz/DeepCAD/data/pc_cad

I got the error:

Traceback (most recent call last):
File "pc2cad.py", line 246, in
outputs, losses = agent.train_func(data)
File "/public1/tz/DeepCAD/trainer/base.py", line 118, in train_func
outputs, losses = self.forward(data)
File "pc2cad.py", line 159, in forward
pred_code = self.net(points)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "pc2cad.py", line 138, in forward
xyz, features = module(xyz, features)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/pointnet2_ops/pointnet2_modules.py", line 66, in forward
new_features = self.mlpsi # (B, mlp[-1], npoint, nsample)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/container.py", line 100, in forward
input = module(input)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 106, in forward
exponential_average_factor, self.eps)
File "/home/server/anaconda3/envs/DeepCAD/lib/python3.7/site-packages/torch/nn/functional.py", line 1923, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

Package Version Location


absl-py 1.0.0
cachetools 4.2.4
certifi 2021.10.8
charset-normalizer 2.0.7
cycler 0.11.0
Cython 0.29.13
future 0.18.2
google-auth 2.3.3
google-auth-oauthlib 0.4.6
grpcio 1.41.1
h5py 2.10.0
hydra-core 0.11.3
idna 3.3
importlib-metadata 4.8.2
joblib 0.14.1
kiwisolver 1.3.2
lmdb 1.2.1
loguru 0.5.3
Markdown 3.3.4
matplotlib 3.1.3
msgpack 1.0.2
msgpack-numpy 0.4.7.1
numpy 1.18.1
oauthlib 3.1.1
omegaconf 1.4.1
Pillow 8.3.2
pip 21.0.1
plyfile 0.7.2
pointnet2 3.0.0 /public1/tz/Pointnet2_PyTorch-master
pointnet2-ops 3.0.0
protobuf 3.19.1
pyasn1 0.4.8
pyasn1-modules 0.2.8
pyparsing 3.0.6
python-dateutil 2.8.2
pytorch-lightning 0.7.1
PyYAML 6.0
requests 2.26.0
requests-oauthlib 1.3.0
rsa 4.7.2
scikit-learn 0.24.2
scipy 1.4.1
setuptools 58.0.4
six 1.16.0
tensorboard 2.7.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorboardX 2.0
threadpoolctl 3.0.0
torch 1.5.1
torchvision 0.6.1
tqdm 4.42.1
trimesh 3.2.19
typing-extensions 4.0.0
urllib3 1.26.7
vtk 9.0.1
Werkzeug 2.0.2
wheel 0.37.0
zipp 3.6.0

I have two RTX3090,CUDA10.2,CuDNN7.6.5,Pytorch1.5.1,Python3.7

下游应用

在您的描述中:自编码器可以把CAD模型编码为潜在向量z;然后可以利用PointNet ++编码器训练它将M的点云表示编码为相同的潜在向量z。
这里我有点不太懂:自编码器的输入是CAD模型的命令序列,而PointNet ++的输入是点云,他们两个为什么能编码为相同的潜在向量呢?

h5格式无法可视化

(DeepCAD) D:\DeepCAD-master\utils>python export2step.py --src ../data/cad_vec/0000 --form h5
../data/cad_vec/0000\00000007.h5
Traceback (most recent call last):
File "export2step.py", line 38, in
out_vec = fp["out_vec"][:].astype(np.float)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "D:\Anaconda3\envs\DeepCAD\lib\site-packages\h5py_hl\group.py", line 328, in getitem
oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5o.pyx", line 190, in h5py.h5o.open
KeyError: "Unable to open object (object 'out_vec' doesn't exist)"

About the augmentation technique

Hi Chris,

I found that you have adopted the data augmentation technique in your paper and achieved even better result than the standard model. However, it happened that the data augmentation technique does not appear in this repository.

I wonder if the data augmentation technique appears in the repository or in somewhere else. If not, how can I augment the data myself?

Thanks and best regards.

Weijian Ma

PointNet++ Support

As you described in the applications

using pointnet2 to encoder the point cloud to the latent code?

Can you release the details of it?

I want to re-implement this experiment.

THX

Example for visualization

Hello. Very impressive project.
Just want to ask, is it possible to provide some example data (e.g. 1 or 2 files) for the inference and visualization for 1) cad estimation with gt, and 2)pointcloud estimated cad with it's ground truth?

A side-by-side comparison can help people to understand the difference quicker.
Specifically for the "show.py" and step file.

Thanks again for the great repo!

Kind Regards,
Tsun-Yi

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.