You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been struggling for some time to make OpenDR work in some other project I have found on github (https://github.com/silviazuffi/smalr_online). So, apparently, even though the renderer parameters, vertices, faces etc seem to make sense, the r it returns contains only zeros. The rendered image is then empty.
Some other script (https://smpl.is.tue.mpg.de/downloads -> Download version 1.1.0 for Python 2.7 (male, female, neutral all with 300 shape PCs) -> smpl -> smpl_webuser -> hello_world -> render_smpl.py (cannot share the code) seems to actually render the image properly, though the input and the renderer setup are very similar.
Is anyone familiar with a similar issue? I use Ubuntu 18.04, Python 3.8, latest version of opend from PyPi.
The text was updated successfully, but these errors were encountered:
UPD: This is probably one of the weirdest error I have encountered (that is why I apologize for the original description, that was not really detailed - I was really clueless about the possible source).
After (quite) some time, I have discovered that the OpenGL imports breaks the renderer. Or, at least they do for me. I have managed to make a (hopefully) reproducible example, based on the OpenDR demo:
import chumpy as ch
from OpenGL.GL import glPixelStorei, glMatrixMode, glHint, glTexParameterf, glDisableClientState
from opendr.renderer import ColoredRenderer
from opendr.lighting import LambertianPointLight
rn = ColoredRenderer()
from opendr.util_tests import get_earthmesh
m = get_earthmesh(trans=ch.array([0,0,4]), rotation=ch.zeros(3))
w, h = (320, 240)
from opendr.camera import ProjectPoints
rn.camera = ProjectPoints(v=m.v, rt=ch.zeros(3), t=ch.zeros(3), f=ch.array([w,w])/2., c=ch.array([w,h])/2., k=ch.zeros(5))
rn.frustum = {'near': 1., 'far': 10., 'width': w, 'height': h}
rn.set(v=m.v, f=m.f, bgcolor=ch.zeros(3))
rn.vc = LambertianPointLight(
f=m.f,
v=rn.v,
num_verts=len(m.v),
light_pos=ch.array([-1000,-1000,-1000]),
vc=m.vc,
light_color=ch.array([1., 1., 1.]))
import cv2
cv2.imshow('example', rn.r)
cv2.waitKey(0)
cv2.destroyAllWindows()
The from OpenGL.GL import glPixelStorei, glMatrixMode, glHint, glTexParameterf, glDisableClientState line makes the renderer output equal to 0. If I comment this line OR move this line after the opendr imports, the renderer suddenly works. Now, I am not sure if this is the problem of OpenGL, or the opendr, but there seem to be some conflict, which I am not sure how to address.
I get this issue on the Ubuntu 18.04, PyOpenGL 3.1.4 and 3.1.5 (tried both), opendr 0.78.
Good afternoon,
I have been struggling for some time to make OpenDR work in some other project I have found on github (https://github.com/silviazuffi/smalr_online). So, apparently, even though the renderer parameters, vertices, faces etc seem to make sense, the
r
it returns contains only zeros. The rendered image is then empty.Some other script (https://smpl.is.tue.mpg.de/downloads -> Download version 1.1.0 for Python 2.7 (male, female, neutral all with 300 shape PCs) -> smpl -> smpl_webuser -> hello_world -> render_smpl.py (cannot share the code) seems to actually render the image properly, though the input and the renderer setup are very similar.
Is anyone familiar with a similar issue? I use Ubuntu 18.04, Python 3.8, latest version of
opend
from PyPi.The text was updated successfully, but these errors were encountered: