akanazawa / hmr

Project page for End-to-end Recovery of Human Shape and Pose
Other
1.54k stars 395 forks source link

Demo run failed with opendr package code error #89

Closed Robert-xiaoqiang closed 5 years ago

Robert-xiaoqiang commented 5 years ago

issue Hi! I was learning your outstanding works. I configured the python virtualenv and run the demo according to the README.md. Unfortunately, I met IndexError in opendr.renderer.py. who can help me?

(venv) qindomitable@ubuntu:Downloads/hmr-master $ python -m demo --img_path data/random.jpg --json_path data/random_keypoints.json
Iteration 0
Iteration 1
Reuse is on!
Iteration 2
Reuse is on!
Restoring checkpoint /home/qindomitable/Downloads/hmr-master/src/../models/model.ckpt-667589..
src/util/renderer.py:313: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  if np.issubdtype(image.dtype, np.float):
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/qindomitable/Downloads/hmr-master/demo.py", line 147, in <module>
    main(config.img_path, config.json_path)
  File "/home/qindomitable/Downloads/hmr-master/demo.py", line 134, in main
    visualize(img, proc_param, joints[0], verts[0], cams[0])
  File "/home/qindomitable/Downloads/hmr-master/demo.py", line 51, in visualize
    vert_shifted, cam=cam_for_render, img=img, do_alpha=True)
  File "src/util/renderer.py", line 79, in __call__
    color_id=color_id)
  File "src/util/renderer.py", line 225, in render_model
    imtmp = simple_renderer(rn, verts, faces, color=color)
  File "src/util/renderer.py", line 179, in simple_renderer
    return rn.r
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/chumpy/ch.py", line 596, in r
    self._cache['r'] = np.asarray(np.atleast_1d(self.compute_r()), dtype=np.float64, order='C')
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 287, in compute_r
    return self.color_image # .reshape((self.frustum['height'], self.frustum['width'], -1)).squeeze()
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/chumpy/ch.py", line 1213, in with_caching
    sdf['value'] = func(self, *args, **kwargs)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 387, in color_image
    no_overdraw = self.draw_color_image(gl)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 377, in draw_color_image
    bg_px = np.tile(np.atleast_3d(self.visibility_image) == 4294967295, (1,1,self.num_channels)).squeeze()
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/chumpy/ch.py", line 1213, in with_caching
    sdf['value'] = func(self, *args, **kwargs)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 60, in visibility_image
    return draw_visibility_image(self.glb, self.v.r, self.f, self.boundarybool_image if self.overdraw else None)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/chumpy/ch.py", line 1213, in with_caching
    sdf['value'] = func(self, *args, **kwargs)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 65, in boundarybool_image
    boundaryid_image = self.boundaryid_image
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/chumpy/ch.py", line 1213, in with_caching
    sdf['value'] = func(self, *args, **kwargs)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 55, in boundaryid_image
    return draw_boundaryid_image(self.glb, self.v.r, self.f, self.vpe, self.fpe, self.camera)
  File "/home/qindomitable/Downloads/hmr-master/venv/local/lib/python2.7/site-packages/opendr/renderer.py", line 688, in draw_boundaryid_image
    visibility[visible] = silhouette_edges[visibility[visible]]
IndexError: index 8388607 is out of bounds for axis 0 with size 1473

environment Ubuntu17.10 Python2.7 virtualenv tensorflow(CPU) 1.3.0

Robert-xiaoqiang commented 5 years ago

Haaaa! I have fixed it by using opendr==0.76 not opendr==0.78. hope this will help others.