NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more
https://nvlabs.github.io/instant-ngp
Other
15.57k stars 1.89k forks source link

How to export mesh.obj from nerf using SDF data? #1503

Open piwawa opened 5 months ago

piwawa commented 5 months ago
python scripts/run.py \
    --scene data/sdf/bunny.obj \
    --load_snapshot data/sdf/base.ingp \
    --save_snapshot data/sdf/base.ingp \
    --n_steps 100000

I have trained a NeRF model using the command above. But when i want to export mesh using the following command, i got an empty file.

python scripts/run.py \
    --scene data/sdf/bunny.obj \
    --load_snapshot data/sdf/base.ingp \
    --marching_cubes_res 512 \
    --save_mesh data/sdf/mesh.obj

23:29:55 SUCCESS  Initialized CUDA 11.8. Active GPU is #0: NVIDIA GeForce RTX 4090 [89]
23:29:55 SUCCESS  Detected auxiliary GPUs:
23:29:55 SUCCESS    #1: NVIDIA GeForce RTX 2080 Ti [75]
23:29:55 INFO     Loading mesh from 'data/sdf/bunny.obj'
23:29:55 SUCCESS  Loaded mesh "data/sdf/bunny.obj" file with 1 shapes.
23:29:55 SUCCESS  Built TriangleBvh: nodes=1365
23:29:55 SUCCESS  Built OptiX GAS and shaders
23:29:55 SUCCESS  Built TriangleOctree: depth=10 nodes=287672 dual_nodes=1150347. Populating dual nodes...
23:29:56 SUCCESS  Loaded mesh after 1s
23:29:56 INFO       n_triangles=4968 aabb=[min=[-0.0956273,0.032063,-0.0629261], max=[0.0620257,0.188243,0.0599615]]
23:29:56 INFO     Loading network snapshot from: data/sdf/bunny/base.ingp
23:29:56 INFO     GridEncoding:  Nmin=16 b=1.38191 F=2 T=2^19 L=16
23:29:56 INFO     Model:         3--[HashGrid]-->32--[FullyFusedMLP(neurons=64,layers=4)]-->1
23:29:56 INFO       total_encoding_params=12196240 total_network_params=7168
Generating mesh via marching cubes and saving to data/sdf/bunny/mesh.obj. Resolution=[512,512,512], Density Threshold=2.5
23:29:56 INFO     #vertices=0 #triangles=0

How to solve this?

anikimmel commented 2 weeks ago

Did you ever figure this out? I also have the same problem...

piwawa commented 2 weeks ago

Did you ever figure this out? I also have the same problem...

Nope, I'm too lazy to try more.