NVlabs / BundleSDF

[CVPR 2023] BundleSDF: Neural 6-DoF Tracking and 3D Reconstruction of Unknown Objects
https://bundlesdf.github.io/
Other
1.05k stars 114 forks source link

get_mesh mode fails -- File "run_custom.py", line 209, in <module> postprocess_mesh(out_folder=args.out_folder) File "run_custom.py", line 162, in postprocess_mesh #24

Closed monajalal closed 1 year ago

monajalal commented 1 year ago

I successfully finished step 1 and optional step 2 for milk demo data with stride of 5 and number of frames set to 500 (as mentioned in https://github.com/NVlabs/BundleSDF/issues/15#issuecomment-1609543665). However, I get error at step 3. output of step 2:

(py38) root@bundlesdf:/home/azureuser/BundleSDF# python run_custom.py --mode global_refine --video_dir /home/azureuser/BundleSDF/milk/2022-11-18-15-10-24_milk  --out_folder /home/azureuser/BundleSDF/milk/out

ETC
loor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').  uvs_unique = torch.stack((uvs_flat_unique%(W-1), uvs_flat_unique//(W-1)), dim=-1).reshape(-1,2)
project train_images 1/50
project train_images 2/50
project train_images 3/50
project train_images 4/50
project train_images 5/50
project train_images 6/50
project train_images 7/50
project train_images 8/50
project train_images 9/50
project train_images 10/50
project train_images 11/50
project train_images 12/50
project train_images 13/50
project train_images 14/50
project train_images 15/50
project train_images 16/50
project train_images 17/50
project train_images 18/50
project train_images 19/50
project train_images 20/50
project train_images 21/50
project train_images 22/50
project train_images 23/50
project train_images 24/50
project train_images 25/50
project train_images 26/50
project train_images 27/50
project train_images 28/50
project train_images 29/50
project train_images 30/50
project train_images 31/50
project train_images 32/50
project train_images 33/50
project train_images 34/50
project train_images 35/50
project train_images 36/50
project train_images 37/50
project train_images 38/50
project train_images 39/50
project train_images 40/50
project train_images 41/50
project train_images 42/50
project train_images 43/50
project train_images 44/50
project train_images 45/50
project train_images 46/50
project train_images 47/50
project train_images 48/50
project train_images 49/50
Done
[2023-06-29 09:24:40.101] [warning] [Bundler.cpp:59] Destructor

output of step 3:

[2023-06-29 09:24:40.101] [warning] [Bundler.cpp:59] Destructor
(py38) root@bundlesdf:/home/azureuser/BundleSDF# python run_custom.py --mode get_mesh --video_dir /home/azureuser/BundleSDF/milk/2022-11-18-15-10-24_milk  --out_folder /home/azureuser/BundleSDF/milk/out
Traceback (most recent call last):
  File "run_custom.py", line 209, in <module>
    postprocess_mesh(out_folder=args.out_folder)
  File "run_custom.py", line 162, in postprocess_mesh
    print(f"Using {mesh_files[-1]}")
IndexError: list index out of range

These are the folders/files created based on time in out folder:

drwxr-xr-x   3 root root 4.0K Jun 28 08:25 1668813041189011440
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 1668813041351297633
drwxr-xr-x   3 root root 4.0K Jun 28 08:25 1668813041518961901
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 ob_in_cam
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 color
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 depth
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 depth_filtered
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 normal
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 mask
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 color_segmented
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 depth_vis
drwxr-xr-x   2 root root 4.0K Jun 28 08:25 1668813041689867935
drwxr-xr-x 114 root root 4.0K Jun 28 08:33 .
-rw-r--r--   1 root root 2.5K Jun 29 09:17 config_bundletrack.yml
drwxr-xr-x   4 root root 4.0K Jun 29 09:17 final
drwxr-xr-x   2 root root 4.0K Jun 29 09:19 nerf_with_bundletrack_online
-rw-r--r--   1 root root 5.4M Jun 29 09:19 mesh_cleaned.obj
-rw-r--r--   1 root root 297K Jun 29 09:24 material_0.png
-rw-r--r--   1 root root  198 Jun 29 09:24 material.mtl
-rw-r--r--   1 root root  18M Jun 29 09:24 textured_mesh.obj

It is looking for "normalized_space.obj" which doesn't exist: ` (py38) root@bundlesdf:/home/azureuser/BundleSDF# find . -name "normalized_space.obj" `

(py38) root@bundlesdf:/home/azureuser/BundleSDF# rg "normalized_space"     
nerf_runner.py
830:          dir = os.path.join(self.cfg['save_dir'], f'step_{self.global_step:07d}_mesh_normalized_space.obj')

run_custom.py
161:  mesh_files = sorted(glob.glob(f'{out_folder}/**/nerf/*normalized_space.obj',recursive=True))

bundlesdf.py
744:    # mesh_files = sorted(glob.glob(f"{self.debug_dir}/final/nerf/step_*_mesh_normalized_space.obj"))

benchmark_ho3d.py
40:      pred_mesh_file = sorted(glob.glob(f"{dir}/**/*mesh_normalized_space.obj",recursive=True))[-1]

and

    if self.global_step % self.cfg['i_mesh'] == 0 and self.global_step > 0:
      with torch.no_grad():
        model = self.models['model_fine'] if self.models['model_fine'] is not None else self.models['model']
        mesh = self.extract_mesh(isolevel=0, voxel_size=self.cfg['mesh_resolution'])
        self.mesh = copy.deepcopy(mesh)
        if mesh is not None:
          dir = os.path.join(self.cfg['save_dir'], f'step_{self.global_step:07d}_mesh_normalized_space.obj')
wenbowen123 commented 1 year ago

https://github.com/NVlabs/BundleSDF/issues/28