From 29aaeb8eb80b8287ce6b07ea611ab3a0418cc859 Mon Sep 17 00:00:00 2001 From: tempoxylophone <15273090+tempoxylophone@users.noreply.github.com> Date: Wed, 24 Jan 2024 22:31:14 -0500 Subject: [PATCH 1/2] Removed setting OS PYOPENGL_PLATFORM in vis_tools.py --- src/body_visualizer/tools/vis_tools.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/body_visualizer/tools/vis_tools.py b/src/body_visualizer/tools/vis_tools.py index d422b20..a540259 100644 --- a/src/body_visualizer/tools/vis_tools.py +++ b/src/body_visualizer/tools/vis_tools.py @@ -25,13 +25,12 @@ import cv2 import os import trimesh -# import platform -# if 'Ubuntu' in platform.version(): -# print('In Ubuntu, using osmesa mode for rendering') -# os.environ['PYOPENGL_PLATFORM'] = 'osmesa' -# else: -# print('In other system, using egl mode for rendering') -os.environ['PYOPENGL_PLATFORM'] = 'egl' + +# Depending on operating system, one may need to set this environment variable, like this: +# os.environ['PYOPENGL_PLATFORM'] = 'egl' +# See related issues that may provide leads to fix it if needed: +# https://github.com/mkocabas/VIBE/issues/101 +# https://github.com/MPI-IS/mesh/issues/49#issuecomment-705194582 colors = { From 4d03b3a260dfa18964afbd6c6aa422739b5c4070 Mon Sep 17 00:00:00 2001 From: tempoxylophone <15273090+tempoxylophone@users.noreply.github.com> Date: Wed, 24 Jan 2024 22:38:46 -0500 Subject: [PATCH 2/2] Fix argument order of meshes_as_png for width and height --- src/body_visualizer/tools/vis_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/body_visualizer/tools/vis_tools.py b/src/body_visualizer/tools/vis_tools.py index a540259..96b1f16 100644 --- a/src/body_visualizer/tools/vis_tools.py +++ b/src/body_visualizer/tools/vis_tools.py @@ -178,7 +178,7 @@ def meshes_as_png(meshes, outpath=None, view_angles=[0, 180]): imw = 800 imh = 800 - mv = MeshViewer(imh, imw) + mv = MeshViewer(width=imw, height=imh) mv.set_cam_trans([0, -.5, 1.75]) images = np.zeros([len(meshes), len(view_angles), 1, imw, imh, 3]) for mIdx, mesh in enumerate(meshes):