alievk / npbg

Neural Point-Based Graphics
MIT License
324 stars 51 forks source link

problem running the example #5

Closed ttsesm closed 4 years ago

ttsesm commented 4 years ago

Hi,

I am trying to run the example code from the readme file but I am getting the following error:

$ python viewer.py --config downloads/person_1.yaml --viewport 2000,1328 --origin-view
loading pointcloud...
Traceback (most recent call last):
  File "viewer.py", line 434, in <module>
    my_app = MyApp(args)
  File "viewer.py", line 112, in __init__
    self.scene_data = load_scene_data(args.config)
  File "/home/ttsesm/Development/npbg/npbg/gl/utils.py", line 263, in load_scene_data
    pointcloud = import_model3d(fix_relative_path(config['pointcloud'], path))
  File "/home/ttsesm/Development/npbg/npbg/gl/utils.py", line 431, in import_model3d
    model['rgb'] = data.colors[0][:, :3] / 255.
IndexError: too many indices for array

any idea what could be the cause?

alievk commented 4 years ago

Probably this is caused by the trimesh version mismatch. Which version do you have?

bobluoluo commented 4 years ago

I got the same problem. My trimesh is 3.7.13. It was automatically installed by the "install_deps" script. What's correct version I should install to evaluate this repo?

seva100 commented 4 years ago

@ttsesm @bobluoluo please try substituting a line 431 in npbg/utils/gl.py from model['rgb'] = data.colors[0][:, :3] / 255. to model['rgb'] = data.colors[:, :3] / 255.

Please tell us if this helps.

ttsesm commented 4 years ago

On my side, I had trimesh 3.7.12 installed automatically by the "install_deps" script.

In any case applying @seva100's fix did the trick for me.

Created a PR with the suggested fix.

seva100 commented 4 years ago

Thanks @ttsesm! Merged.