Florian-Barthel / gaussian_viewer

Interactive 3D Gaussian Splatting viewer for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some error

oUp2Uo opened this issue · comments

Hi, I found some error when I tried to test this program.

1.When just using mouse to rotate the model, the program stopped.
And here is the log.

(gs-view) C:\Users\Up2U\Desktop\gaussian_viewer>python main.py --data_path="C:\Users\Up2U\Desktop\week\2024\0219-0223"
Traceback (most recent call last):
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 163, in <module>
    main()
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 158, in main
    viz.draw_frame()
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 115, in draw_frame
    self._async_renderer.set_args(**self.args)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz\async_renderer.py", line 48, in set_args
    something_changed = not equal_dicts(args, self._cur_args)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz_utils\compare_dict.py", line 11, in equal_dicts
    if not torch.equal(dict1[key], dict2[key]):
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument other in method wrapper_CUDA__equal)
  1. After using mouse to change the camera rotation, then click Set current direction in Camera tag, the model went to a wrong position and the program stopped.
    Here is the log.
(gs-view) C:\Users\Up2U\Desktop\gaussian_viewer>python main.py --data_path="C:\Users\Up2U\Desktop\week\2024\0219-0223"
Traceback (most recent call last):
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 163, in <module>
    main()
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 158, in main
    viz.draw_frame()
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 115, in draw_frame
    self._async_renderer.set_args(**self.args)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz\async_renderer.py", line 48, in set_args
    something_changed = not equal_dicts(args, self._cur_args)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz_utils\compare_dict.py", line 11, in equal_dicts
    if not torch.equal(dict1[key], dict2[key]):
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument other in method wrapper_CUDA__equal)
  1. When try to use the Video function, the program stopped.
    Here is the log.
(gs-view) C:\Users\Up2U\Desktop\gaussian_viewer>python main.py --data_path="C:\Users\Up2U\Desktop\week\2024\0219-0223"
Traceback (most recent call last):
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 163, in <module>
    main()
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 158, in main
    viz.draw_frame()
  File "C:\Users\Up2U\Desktop\gaussian_viewer\main.py", line 103, in draw_frame
    self.video_widget(expanded)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\gui_utils\imgui_utils.py", line 85, in decorator
    res = method(self, *args, **kwargs)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\widgets\video_widget.py", line 45, in __call__
    extrinsic = LookAtPoseSampler.sample(x, np.pi / 2 + self.cam_height, torch.tensor([0., 0., 0.]), radius=self.radius)[0]
TypeError: LookAtPoseSampler.sample() missing 1 required positional argument: 'up_vector'
  1. (not error) What does Radius mean in Camera tag?

Thank you.

Hey, thanks for pointing our those errors!
I have made some changes that should resolve them. Let me know if it works.

  1. The Radius in the camera tab defines the radius of the orbiting video camera around the object. I have decided to separate the camera parameters of the viewer from the camera parameter used in the video generation, in order to easily reproduce videos across different scenes. For the future, I will try to think of a more intuitive way to set the video camera parameter (eg. an example rendering from the video camera perspective)

Thanks for the reply.

I have decided to separate the camera parameters of the viewer from the camera parameter used in the video generation, in order to easily reproduce videos across different scenes.

So Radius just means the distance betweent camera and the target view point, right?
This is cool.

1~2 fixed.
But 3 still has problem.
Folder path is not correct.

(gs-view) C:\Users\Up2U\Desktop\gaussian_viewer>python main.py --data_path="C:\Users\Up2U\Desktop\week\2024\0219-0223"

Traceback (most recent call last):
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz\renderer.py", line 47, in render
    self._render_impl(res, **args)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz\renderer.py", line 114, in _render_impl
    self.render_video(f"./videos/{current_ply_name}", video_cams)
  File "C:\Users\Up2U\Desktop\gaussian_viewer\viz\renderer.py", line 146, in render_video
    os.makedirs(save_path, exist_ok=True)
  File "C:\Users\Up2U\miniconda3\envs\gs-view\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
NotADirectoryError: [WinError 267] : './videos/C:_Users_Up2U_Desktop_week_2024_0219-0223_point_cloud_asuna_2k.cleaned.cleaned.cleaned.ply'

Btw, mouse control seems to be weird when rotating to some angle.

I believe this is due to the ":" in the save path. I pushed a change that replaces ":" with "_". This should resolve the problem hopefully.

Yes, I also notice that the mouse control behaves strange sometimes. I think this happens when pressing "Set current direction" in the camera tab. I will look into that.

The Video function is very cool!
I usually just capture the screen to save a video.

The latest version, path bug is fixed.
And I think it will be better if there is parameter to control rotating speed.
And one more thing, it is easier to use if resoluton option could seperate to x/y resolution.

And I found some more bug.
When try to record video more than one time,
and just change some camera parameter like fov / radius / height (not sure which on is actually effect),
sometimes y axis could be inverted.

And if there could be a preview function in video part, for example, click once to generate one sample image,
I think it will be easier to confirm if the parameter is set well.