IGLICT / NeRF-Editing

[CVPR 2022] Code for "NeRF-Editing: Geometry Editing of Neural Radiance Fields"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about mesh editing tool

yuzewang1998 opened this issue · comments

Hi,
Thanks for your efforts in this project. Can you recommend a tool for mesh editing that can generate edited data in the same format as in the readme (deformed_mesh.obj and mesh_seq) I have no idea how to generate the files in this format.
Thank you, looking forward to your reply.

OBJ format is a widely used mesh format, you can find some introductions on Wikipedia.
As for the mesh editing tool, you can try Blender.

OBJ format is a widely used mesh format, you can find some introductions on Wikipedia. As for the mesh editing tool, you can try Blender.

Hi, thanks for your detailed reply. However, I occur another trouble.
I follow the READ.ME to training, extract mesh.
image
On the top is the mesh result visualised by MeshLab, and the following is the rendering result:
00000035
It seems successfully render the images before editing.
Then I follow the steps to construct cage, construct tetrahedral, convert to ovm format, it seems alright.
Below is cage mesh result:
image
Then I use Blender to deform the extract mesh (not the cage mesh) and put down the Lego bulldozer's shovel as the same view as paper in Fig.4:
image
Then I propagate editing and get the controlpoint.txt which seems right:

1
216282
-0.638937 -1.136863 -0.331373
-0.637255 -1.139047 -0.331373
-0.637255 -1.136863 -0.335547
-0.640510 -1.136863 -0.321177
-0.637255 -1.141268 -0.321177
...

Then I success deform the tetrehedra mesh arap_result_0000_.ovm
Howerver when I ready to rendering after editing, I occur the following error:

~/devdata/NeRF-Editing/src$ python exp_runner.py --mode circle --conf ./confs/wmask_lego_render.conf --case lego_w_mask --is_continue --use_deform --reconstructed_mesh_file ./logs/lego_w_mask/meshes/mesh_cage_nofloor_.txt --deformed_mesh_file ./logs/lego_w_mask/mesh_seq_ovm/arap_result_0000_.ovm --obj_path ./logs/lego_w_mask/meshes/deformed_mesh.obj 
[i 0924 14:26:52.236749 24 compiler.py:955] Jittor(1.3.5.15) src: /home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor
[i 0924 14:26:52.241330 24 compiler.py:956] g++ at /usr/bin/g++(9.4.0)
[i 0924 14:26:52.241400 24 compiler.py:957] cache_path: /home/slam/.cache/jittor/jt1.3.5/g++9.4.0/py3.7.13/Linux-5.15.0-4xee/IntelRCoreTMi7x93/default
[i 0924 14:26:52.249478 24 install_cuda.py:88] cuda_driver_version: [11, 4]
[i 0924 14:26:52.254714 24 __init__.py:411] Found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc(11.2.152) at /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/bin/nvcc.
[i 0924 14:26:52.288873 24 __init__.py:411] Found gdb(20.04.1) at /usr/bin/gdb.
[i 0924 14:26:52.293975 24 __init__.py:411] Found addr2line(2.34) at /usr/bin/addr2line.
[i 0924 14:26:52.400405 24 compiler.py:1010] cuda key:cu11.2.152_sm_61
[i 0924 14:26:52.538085 24 __init__.py:227] Total mem: 15.59GB, using 5 procs for compiling.
[i 0924 14:26:52.654067 24 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 0924 14:26:52.716258 24 py_var_tracer.cc:22] Load trace_py_var: 3
[i 0924 14:26:52.716428 24 init.cc:62] Found cuda archs: [61,]
[i 0924 14:26:52.735387 24 __init__.py:411] Found mpicc(4.0.3) at /usr/bin/mpicc.
[i 0924 14:26:52.824957 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include/cublas.h
[i 0924 14:26:52.832866 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcublas.so
[i 0924 14:26:52.832952 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcublasLt.so.11
[i 0924 14:26:53.036392 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include/cudnn.h
[i 0924 14:26:53.049903 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcudnn.so.8
[i 0924 14:26:53.050021 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcudnn_ops_infer.so.8
[i 0924 14:26:53.052424 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcudnn_ops_train.so.8
[i 0924 14:26:53.052771 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcudnn_cnn_infer.so.8
[i 0924 14:26:53.069074 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcudnn_cnn_train.so.8
[i 0924 14:26:53.303992 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include/curand.h
[i 0924 14:26:53.320540 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcurand.so
[i 0924 14:26:53.335791 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/include/cufft.h
[i 0924 14:26:53.351945 24 compile_extern.py:30] found /home/slam/.cache/jittor/jtcuda/cuda11.2_cudnn8_linux/lib64/libcufft.so
[i 0924 14:26:53.486972 24 cuda_flags.cc:32] CUDA enabled.
Hello Wooden
use test render NeuS Renderer: sparse sampling ...
Load data: Begin
[i 0924 14:26:54.100894 24 cuda_flags.cc:32] CUDA enabled.
Use the nerf synthetic dataset
Load data: End
[exp_runner.py:88 -             __init__() ] Find checkpoint: ckpt_240000.pkl
[exp_runner.py:227 -      load_checkpoint() ] End
set render raids to 3.5 !
the max degree of vertices in tets is 56
finish constructing Cage hulls !
[load.py:224 -            load_mesh() ] loaded <trimesh.Trimesh(vertices.shape=(216282, 3), faces.shape=(432824, 3))> using load_obj
[constants.py:137 -                timed() ] load_mesh executed in 0.6975 seconds.
render the 0 / 40 image
[e 0924 14:27:49.731194 24 mem_info.cc:96] {1:7675, } 0
Traceback (most recent call last):
  File "exp_runner.py", line 657, in <module>
    args.use_deform, args.obj_path, args.fix_camera, args.is_view_dependent, args.savedir, add_alpha=args.add_alpha)
  File "exp_runner.py", line 553, in render_circle_image
    images.append(self.render_image(render_pose, use_deform, queryDelta, hull, deltas, mesh, c2w_staticcam))
  File "exp_runner.py", line 395, in render_image
    vis_coord_ind=vis_coord_ind)
  File "/home/slam/devdata/NeRF-Editing/src/models/renderer.py", line 339, in render
    cos_anneal_ratio=cos_anneal_ratio)
  File "/home/slam/devdata/NeRF-Editing/src/models/renderer.py", line 195, in render_core
    sdf[setZero.reshape(-1)] = 10000
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/contrib.py", line 203, in setitem
    slices = slices.where()
RuntimeError: [f 0924 14:27:49.731242 24 executor.cc:665] 
Execute fused operator(2531/2705) failed. 
[JIT Source]: /home/slam/.cache/jittor/jt1.3.5/g++9.4.0/py3.7.13/Linux-5.15.0-4xee/IntelRCoreTMi7x93/default/cu11.2.152_sm_61/jit/getitem__Ti_int32__IDIM_2__ODIM_2__FOV_0__VD_1__IV0_0__IO0__1__VS0_1__VST0_int32__IV1__1_____hash_f33eef91f19b9d2_op.cc 
[OP TYPE]: getitem 
[Input]: int32[289783,4,], int32[12800,], 
[Output]: int32[12800,4,], 
[Async Backtrace]: --- 
     exp_runner.py:657 <<module>> 
     exp_runner.py:553 <render_circle_image> 
     exp_runner.py:395 <render_image> 
     /home/slam/devdata/NeRF-Editing/src/models/renderer.py:309 <render> 
     /home/slam/devdata/NeRF-Editing/src/utils.py:476 <queryDelta> 
     /home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/contrib.py:192 <getitem> 
[Reason]: [f 0924 14:27:49.728966 24 helper_cuda.h:128] CUDA error at /home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/src/executor.cc:618  code=700( cudaErrorIllegalAddress ) cudaDeviceSynchronize()
[e 0924 14:27:49.745220 24 helper_cuda.h:117] Peek CUDA error at /home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/src/mem/allocator/cuda_dual_allocator.h:101  code=700( cudaErrorIllegalAddress ) _cudaLaunchHostFunc(0, &to_free_allocation, 0)
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
cupy_backends.cuda.api.driver.CUDADriverError: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/slam/miniconda3/envs/nerfediting/lib/python3.7/site-packages/jittor/__init__.py", line 1696, in exc_handler
AttributeError: 'NoneType' object has no attribute 'print_exception'

Original exception was:
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Exception ignored in: 'cupy.cuda.function.Module.__dealloc__'
Traceback (most recent call last):
  File "cupy_backends/cuda/api/driver.pyx", line 260, in cupy_backends.cuda.api.driver.moduleUnload
  File "cupy_backends/cuda/api/driver.pyx", line 125, in cupy_backends.cuda.api.driver.check_status
TypeError: 'NoneType' object is not callable
Error in sys.excepthook:

Original exception was:
Error in sys.excepthook:

Original exception was:

And what I only modify the code is to set runner.batch_size from 300 to 200.
It seems that 'get_item' went something wrong. Do you have any suggestions about this error report? Is it possible that I have a problem with the previous steps.
Thanks, I really very interested in this work and looking forward to your reply.

Thank you very much for your interest in our work! Every step looks good! The last step is rendering. I have tested the code on my side, and I don't have the problem you mentioned. Can you share your reconstructed model, deformed model, and corresponding cage mesh with me?

Thank you for your quickly response and kindly help. I upload the model to Google Drive: https://drive.google.com/drive/folders/1ANGqNI8OTbuHd4Kvsffscz-CzZ1JdUC5
All the file named as the README guided.
Thank you very much again.

Thanks for your sharing! I have reproduced your problem and fixed the bug, it is an issue with the index. I have uploaded the modifications to the repo. The modifications are only in the utils.py file, you just need to replace it. Below is an edited rendering generated with your data.
00000006

Thank you for your timely reply! I have successfully rendered amazing results. I will be excited to try more editing by NeRF-Editing~
00000020