factor-fields icon indicating copy to clipboard operation
factor-fields copied to clipboard

How to export the mesh file, such as .obj or .ply file

Open muximuxi opened this issue 2 years ago • 5 comments

muximuxi avatar Aug 09 '23 03:08 muximuxi

I see the code.

muximuxi avatar Aug 09 '23 13:08 muximuxi

Can the nerf export the mesh ply file? when I run python train_per_scene.py and set the nerf.yaml config file export_mesh=1, and I can't find the ply file.Expect your reply! thank you.

muximuxi avatar Aug 11 '23 03:08 muximuxi

Okay, could you show me your script?

apchenstu avatar Aug 12 '23 17:08 apchenstu

Okay, could you show me your script? I set the exportation in configs/nerf.yaml like this : exportation: render_only: 0 render_test: 0 render_train: 0 render_path: 0 export_mesh: 1 export_mesh_only: 0 then python train_per_scene.py configs/nerf.yaml defaults.expname=lego dataset.datadir=./data/nerf_synthetic/lego Traceback (most recent call last): File "/root/zst_workspace/jupyter/factor-fields/train_per_scene.py", line 259, in export_mesh("./logs/lego/lego.th") File "FactorFields/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/root/zst_workspace/jupyter/factor-fields/train_per_scene.py", line 35, in export_mesh cfg.defaults.device = device File "FactorFields/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 338, in setattr self._format_and_raise(key=key, value=value, cause=e) File "FactorFields/lib/python3.9/site-packages/omegaconf/base.py", line 190, in _format_and_raise format_and_raise( File "FactorFields/lib/python3.9/site-packages/omegaconf/_utils.py", line 821, in format_and_raise _raise(ex, cause) File "FactorFields/lib/python3.9/site-packages/omegaconf/_utils.py", line 719, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set end OC_CAUSE=1 for full backtrace File "FactorFields/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 334, in setattr self.__set_impl(key, value) File "FactorFields/lib/python3.9/site-packages/omegaconf/dictconfig.py", line 318, in __set_impl self._set_item_impl(key, value) File "FactorFields/lib/python3.9/site-packages/omegaconf/basecontainer.py", line 577, in _set_item_impl self.dict["_content"][key] = wrap(key, value) File "FactorFields/lib/python3.9/site-packages/omegaconf/basecontainer.py", line 542, in wrap return _maybe_wrap( File "FactorFields/lib/python3.9/site-packages/omegaconf/omegaconf.py", line 1035, in _maybe_wrap return _node_wrap( File "FactorFields/lib/python3.9/site-packages/omegaconf/omegaconf.py", line 996, in _node_wrap node = AnyNode(value=value, key=key, parent=parent) File "FactorFields/lib/python3.9/site-packages/omegaconf/nodes.py", line 116, in init super().init( File "FactorFields/lib/python3.9/site-packages/omegaconf/nodes.py", line 27, in init self._set_value(value) # lgtm [py/init-calls-subclass] File "FactorFields/lib/python3.9/site-packages/omegaconf/nodes.py", line 44, in _set_value self._val = self.validate_and_convert(value) File "FactorFields/lib/python3.9/site-packages/omegaconf/nodes.py", line 57, in validate_and_convert return self._validate_and_convert_impl(value) File "FactorFields/lib/python3.9/site-packages/omegaconf/nodes.py", line 133, in _validate_and_convert_impl raise UnsupportedValueType( omegaconf.errors.UnsupportedValueType: Value 'device' is not a supported primitive type full_key: defaults.device object_type=dict

muximuxi avatar Aug 15 '23 08:08 muximuxi

please refer to here you can set export_mesh_only to be true

apchenstu avatar Aug 18 '23 07:08 apchenstu