NVlabs / instant-ngp

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

Record3D conversion #1190

Open satpalsr opened 1 year ago

satpalsr commented 1 year ago

I collected some data using Record3D. I have depth folder, image folder and metadata. While converting with instant-ngp$ python scripts/record3d2nerf.py --scene path/to/data I get this error

0it [00:00, ?it/s]
computing center of attention...
0it [00:00, ?it/s]
Traceback (most recent call last):
  File "scripts/record3d2nerf.py", line 171, in <module>
    translation, scale = find_transforms_center_and_scale(transforms)
  File "scripts/record3d2nerf.py", line 62, in find_transforms_center_and_scale
    translation = min_line_dist(rays_o, rays_d)
  File "scripts/record3d2nerf.py", line 57, in min_line_dist
    A_i = np.eye(3) - rays_d * np.transpose(rays_d, [0,2,1])
  File "<__array_function__ internals>", line 200, in transpose
  File "/home/anaconda3/envs/instant_ngp/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 668, in transpose
    return _wrapfunc(a, 'transpose', axes)
  File "/home/anaconda3/envs/instant_ngp/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
ValueError: axes don't match array
yusuf-wadi commented 1 year ago

I have this exact same issue, maybe there is a slight tweak that we are missing.

ababilinski commented 1 year ago

I had the same issue because I was using the wrong export method. Here are the steps that worked for me:

  1. Make a new 3D video in Record3D.
  2. Export the 3D video into the "Shareable/Internal format (.r3d)".
  3. Copy the .r3d file from my iPhone to my computer.
  4. Extract the .r3d file (it's a ZIP file; you can simply rename the file from .r3d to .zip and extract the .zip file).
  5. Once extracted, you should see a folder with the same name as the .r3d file.
  6. Run the command again (python scripts/record3d2nerf.py --scene path/to/data)