Coder Social home page Coder Social logo

opendr's People

Contributors

algrs avatar classner avatar mattloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opendr's Issues

render only the wireframe

Thanks for the wonderful project!

I would like to render a mesh with wireframe. I was wondering that would it be possible to use opendr to render only the wireframe? Any advice and suggestions will be greatly appreciated!

Is it possible to use Opendr to save the 3d representation in 3d format itself

I have been working with reconstructing people from 2d image into 3d representation. i have been working with a code in github where in it they reconstruct the 3d representation of the human but they are represented in the 2d image itself,but i need it as 3d format and could be saved in such a format. Is there anything i can do using opendr to solve this issue

Installation error

This is the error returned during the installation:

python2.7 setup.py build_ext --inplace
running build_ext
Traceback (most recent call last):
  File "setup.py", line 152, in <module>
    main()
  File "setup.py", line 148, in main
    setup_opendr([mesa_ext()])
  File "setup.py", line 103, in setup_opendr
    'Operating System :: POSIX :: Linux'
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 77, in run
    _build_ext.run(self)
  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 164, in run
    _build_ext.build_ext.run(self)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 337, in run
    self.build_extensions()
  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/build_ext.py", line 172, in build_extensions
    self.build_extension(ext)
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_ext.py", line 193, in build_extension
    ext._convert_pyx_sources_to_lang()
AttributeError: Extension instance has no attribute '_convert_pyx_sources_to_lang'
make: *** [all] Error 1

How can I install OpenDR in CentOS 7 for Python 3?

The following command didn't work. Could you please guide me on how to fix it?

$ pip install opendr
Collecting opendr
  Downloading opendr-0.78.tar.gz (581 kB)
     |████████████████████████████████| 581 kB 1.3 MB/s 
Requirement already satisfied: Cython in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (0.29.22)
Requirement already satisfied: chumpy>=0.58 in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (0.70)
Requirement already satisfied: matplotlib in /scratch3/venv/frank/lib/python3.8/site-packages (from opendr) (3.4.0)
Requirement already satisfied: scipy>=0.13.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.6.2)
Requirement already satisfied: six>=1.11.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from chumpy>=0.58->opendr) (1.15.0)
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /scratch3/venv/frank/lib/python3.8/site-packages (from scipy>=0.13.0->chumpy>=0.58->opendr) (1.20.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (1.3.1)
Requirement already satisfied: pyparsing>=2.2.1 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (2.4.7)
Requirement already satisfied: python-dateutil>=2.7 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (2.8.1)
Requirement already satisfied: cycler>=0.10 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (0.10.0)
Requirement already satisfied: pillow>=6.2.0 in /scratch3/venv/frank/lib/python3.8/site-packages (from matplotlib->opendr) (8.1.2)
Building wheels for collected packages: opendr
  Building wheel for opendr (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /scratch/tmp/pip-wheel-xb1f2chh
       cwd: /scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/
  Complete output (65 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/opendr
  copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
  creating build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  creating build/lib.linux-x86_64-3.8/opendr/test_dr
  copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
  running build_ext
  building 'opendr.contexts.ctx_mesa' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/opendr
  creating build/temp.linux-x86_64-3.8/opendr/contexts
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/scratch3/venv/frank/include -I/usr/local/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
  In file included from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
                   from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from opendr/contexts/ctx_mesa.c:660:
  /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   #warning "Using deprecated NumPy API, disable it with " \
    ^~~~~~~
  opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
  opendr/contexts/ctx_mesa.c:13144:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
     glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                   ^
  In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
                   from opendr/contexts/gl_includes.h:10,
                   from opendr/contexts/ctx_mesa.c:668:
  opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char **’
   GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                       ^~~~~~~~~~~~~~
  gcc -pthread -shared build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
  /usr/bin/ld: cannot find -lOSMesa
  collect2: error: ld returned 1 exit status
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for opendr
  Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: opendr
    Running setup.py install for opendr ... error
    ERROR: Command errored out with exit status 1:
     command: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /scratch/tmp/pip-record-q52my77n/install-record.txt --single-version-externally-managed --compile --install-headers /scratch3/venv/frank/include/site/python3.8/opendr
         cwd: /scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/
    Complete output (65 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/opendr
    copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
    creating build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    creating build/lib.linux-x86_64-3.8/opendr/test_dr
    copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
    running build_ext
    building 'opendr.contexts.ctx_mesa' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/opendr
    creating build/temp.linux-x86_64-3.8/opendr/contexts
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/scratch3/venv/frank/include -I/usr/local/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
    In file included from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1944:0,
                     from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from opendr/contexts/ctx_mesa.c:660:
    /scratch3/venv/frank/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " \
      ^~~~~~~
    opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
    opendr/contexts/ctx_mesa.c:13144:49: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
       glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
                                                     ^
    In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085:0,
                     from opendr/contexts/gl_includes.h:10,
                     from opendr/contexts/ctx_mesa.c:668:
    opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but argument is of type ‘char **’
     GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
                         ^~~~~~~~~~~~~~
    gcc -pthread -shared build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
    /usr/bin/ld: cannot find -lOSMesa
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /scratch3/venv/frank/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"'; __file__='"'"'/scratch/tmp/pip-install-2xl2_aae/opendr_cca5ff679db14567af924447cc43444b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /scratch/tmp/pip-record-q52my77n/install-record.txt --single-version-externally-managed --compile --install-headers /scratch3/venv/frank/include/site/python3.8/opendr Check the logs for full command output.

I have:

$ python
Python 3.8.5 (default, Mar 31 2021, 02:37:07) 
[GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux

and

$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.9.2009 (Core)
Release:	7.9.2009
Codename:	Core


Compatible with Python3?

I was using Python3 and tried to install OpenDR via pip. But I failed and found opendr now seems only compatible with Python 2? So can I know is there any plan to move opendr forward to Python 3? And is there any way I can overcome this currently?

compile has passed in mac os(m1)

first modify _functions.pyx:
change line 640: glBindVertexArray to glBindVertexArrayAPPLE

second modify gl_includes.h:
replace from line 14 to the end:
#ifdef APPLE
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#include <OpenGL/gl3.h>
#include <OpenGL/glu.h>
#include <OpenGL/OpenGL.h>
#include <OpenGL/CGLTypes.h>
#include <OpenGL/glext.h>
#endif
#endif

Derivatives wrt focal

Focal length derivatives are obtained from opencv, but (unlike all the others) doesn't seem to match finite differencing very well. Maybe it's a problem in OpenCV, maybe in OpenDR.

Install debug

An error was occurred to me whill installation.
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb3 in position 0
The problem is located in

open(dest_fname, 'w').write(contents)

When I change it to open(dest_fname, 'wb').write(contents), the bug is fixed.

opendr import error with .so file

Happy Labor's Day!
I have installed OSMesa from source code and installed opendr by pip install opendr successfully.
But when I import opendr in my python code, I met the following error.

ImportError: "/..//opendr/contexts/ctx_mesa.so: undefined symbol: _ZTIN4llvm11RuntimeDyld13MemoryManagerE"

PS: I install OSMesa from this script osmesa-install.sh

Environment:
Ubuntu 16.04
Python 2.7

who can help me? Thanks a lot

hstack bug

This should do the same thing that numpy does, but it raises an exception instead:

import chumpy as ch
ch.hstack((5,5))

The texture rendering quality and how to use multiple texture images

Thank you for your wonderful job on building this amazing differentiable renderer. I am currently trying to reimplement experiment in your ECCV 2014 paper.

Well, I have two question

(1) How to improve the quality of texture rendering? I mean I tried several demos and also my own mesh data, the texture rendering looks blurring. For example, even in the earth demo, your own example(uses an earth map picture as the texture image) lines do not look sharp after rendering. I know that, if you simply use a png image as a texture image, it becomes blurring due to the enlarge and shrink. So can we use vector format image as a texture? Or in general, how to improve the visual effect in general? I mean your ECCV paper showed amazing indoor rendering scene, how can I have the same level of rendering result? Do you have materials so I can re-implement this experiment?(if you willing to share, that will be great. otherwise some general guides will also helps me a lot)

(2) How is your workflow/utility of editing the data you suggest me to do? I mean the OpenDR provides the render API, which is very nice, but I found so far I spend a lot of time to extract the data from a 3d model file and import data, nevertheless to editing it. For example, if I have multiple texture files, I have to manually put the texture data together as one image, then give it to the TexturedRender. Does the OpenDR provide some file reading utility, so I can edit a 3d object in another editing tool and them save it as some file format, then the OpenDR just read the file format and do the rendering? By the way, what editing tool you suggest to use for most convenience?

Thank you so much for answer my question.

compile error

Hi, I try to install it in Ubuntu, I download the source code and run make all.
Then I got such errors

python2.7 setup.py build_ext --inplace
Autogenerating opengl sources
Compiling contexts/ctx_mesa.pyx because it changed.
[1/1] Cythonizing contexts/ctx_mesa.pyx

Error compiling Cython file:

...
"""
^

contexts/ctx_mesa.pyx:1:0: 'opendr-master.contexts.ctx_mesa' is not a valid module name
Traceback (most recent call last):
File "setup.py", line 153, in
main()
File "setup.py", line 149, in main
setup_opendr([mesa_ext()])
File "setup.py", line 63, in setup_opendr
ext_modules=cythonize(ext_modules)
File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 877, in cythonize
cythonize_one(*args)
File "/usr/lib/python2.7/dist-packages/Cython/Build/Dependencies.py", line 997, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: contexts/ctx_mesa.pyx
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 1

Can you help me?

Possibly wrong gradients

Hey Matt,

Not sure if this is correct form (creating an issue after a PR) but I wasn't sure so here'a link to the PR that describes our problem in some detail.

#6

Once again, we'd be delighted to chat with you on this.

Thanks,
Mayur

Installation issue in ARM Processor aarch64

When I try to install the package in ARM processors it gives the following error Exception: Unable to get url: http://files.is.tue.mpg.de/mloper/opendr/osmesa/OSMesa.Linux.aarch64.zip as the file is missing.

Renderer.r contains only 0

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.

Can opendr install on Window 10?

I use pip install opendr but fail.

 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__OSMESA__=1 -Iopendr/contexts -I. -I

c:\python3\lib\site-packages\numpy\core\include -Iopendr/contexts/OSMesa/include -Ic:\python3\include -Ic:\python3\include "-I

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-I

C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-I

C:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /Tcopendr/contexts/ctx_mesa.c /Fobuild\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj -lstdc++

    cl : Command line warning D9002 : ignoring unknown option '-lstdc++'

    ctx_mesa.c

    c:\python3\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated N

umPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

    opendr/contexts/ctx_mesa.c(6900): warning C4244: 'function': conversion from 'npy_intp' to 'GLint', possible loss of

 data

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe 

/nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO 

/LIBPATH:opendr/contexts/OSMesa/lib /LIBPATH:c:\python3\libs 

/LIBPATH:c:\python3\PCbuild\amd64 "

/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "

/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64""

/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "

/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64" "

/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" OSMesa.lib GL.lib GLU.lib 

/EXPORT:PyInit_ctx_mesa build\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj 

/OUT:build\lib.win-amd64-3.7\opendr\contexts\ctx_mesa.cp37-win_amd64.pyd 

/IMPLIB:build\temp.win-amd64-3.7\Release\opendr/contexts\ctx_mesa.cp37-win_amd64.lib -lstdc++

    LINK : warning LNK4044: unrecognized option '/lstdc++'; ignored

    LINK : fatal error LNK1181: cannot open input file 'OSMesa.lib'

    error: command 'C:\\Program Files (x86)\\Microsoft Visual 

Studio14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit status 1181

    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv
[0] = '"'"'C:\\Users\\qiu35\\AppData\\Local\\Temp\\pip-install-jfj72zqv\\opendr\\setup.py'"'"'; __file__='"'"'C:\\Users\
\qiu35\\AppData\\Local\\Temp\\pip-install-jfj72zqv\\opendr\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__fi
le__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' insta
ll --record 'C:\Users\qiu35\AppData\Local\Temp\pip-record-esawqk96\install-record.txt' --single-version-externally-manag
ed --compile Check the logs for full command output.

`from opendr.renderer import ColoredRenderer` fails?

Problem

>>> from opendr.renderer import ColoredRenderer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/software/Anaconda3-4.3.1-Linux-x86_64/envs/py27/lib/python2.7/site-packages/opendr/renderer.py", line 25, in <module>
    from contexts.ctx_mesa import OsContext
ImportError: /software/Anaconda3-4.3.1-Linux-x86_64/envs/py27/lib/python2.7/site-packages/opendr/contexts/ctx_mesa.so: undefined symbol: PyFPE_jbuf

Steps to reproduce

Create a brand-new conda environment py27

conda create -n py27 python=2.7

Activate the environment by

source activate py27

Install OpenDR with

pip install opendr

As a result, pip automatically will install chumpy-0.67.5, numpy-1.13.1, and scipy-0.19.1.

Install OpenCV with

pip install opencv-python

Finally,

(py27) me@machine:~$ python
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> from opendr.renderer import ColoredRenderer

Multiple Depths at a pixel

Hi,

Is it possible to get the depths of mutiple triangles that will be projected on a pixel during rasterization stage using opendr?

Thanks for any help.

OSMesa zip file

When I run python setup.py, I get the following error message generated from the download_osmesa() function:

Traceback (most recent call last):
  File "/home/simone/repo/opendr/setup.py", line 152, in <module>
    main()
  File "/home/simone/repo/opendr/setup.py", line 141, in main
    download_osmesa()
  File "/home/simone/repo/opendr/setup.py", line 46, in download_osmesa
    with zipfile.ZipFile(zip_fname, 'r') as z:
  File "/home/simone/anaconda3/lib/python3.10/zipfile.py", line 1267, in __init__
    self._RealGetContents()
  File "/home/simone/anaconda3/lib/python3.10/zipfile.py", line 1334, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

The error is related to a zip file that the code downloads named OSMesa.Linux.x86_64.zip

glext.h expected ‘const GLchar **’ {aka ‘const char **’} but argument is of type ‘char **’

I am trying to install opendr as a requirement for ZhengZerong/DeepHuman and get this error:

$ venv/bin/python -m pip install -r requirements.txt
ERROR: Command errored out with exit status 1:
   command: /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-ua65t3rl
       cwd: /tmp/pip-install-qq_lrcqv/opendr/
  Complete output (68 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
  copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
  creating build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
  creating build/lib.linux-x86_64-3.8/opendr/test_dr
  copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
  running build_ext
  building 'opendr.contexts.ctx_mesa' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/opendr
  creating build/temp.linux-x86_64-3.8/opendr/contexts
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/include -I/usr/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
  In file included from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832,
                   from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from opendr/contexts/ctx_mesa.c:657:
  /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     17 | #warning "Using deprecated NumPy API, disable it with " \
        |  ^~~~~~~
  opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
  opendr/contexts/ctx_mesa.c:13169:50: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
  13169 |   glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
        |                                                 ~^~~~~~~~~~~
        |                                                  |
        |                                                  char **
  In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085,
                   from opendr/contexts/gl_includes.h:10,
                   from opendr/contexts/ctx_mesa.c:659:
  opendr/contexts/OSMesa/include/GL/glext.h:5794:82: note: expected ‘const GLchar **’ {aka ‘const char **’} but argument is of type ‘char **’
   5794 | GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
        |                                                                   ~~~~~~~~~~~~~~~^~~~~~
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
  /usr/bin/ld: cannot find -lOSMesa
  /usr/bin/ld: cannot find -lGLU
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for opendr
  Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: opendr, PyWavelets, decorator, networkx, imageio, tifffile, scikit-image, opencv-python, astunparse, termcolor, absl-py, google-pasta, protobuf, markdown, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, certifi, chardet, idna, urllib3, requests, oauthlib, requests-oauthlib, google-auth-oauthlib, tensorboard-plugin-wit, werkzeug, grpcio, tensorboard, tensorflow-estimator, wrapt, h5py, opt-einsum, keras-preprocessing, gast, tensorflow
    Running setup.py install for opendr ... error
    ERROR: Command errored out with exit status 1:
     command: /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0e9ez2_r/install-record.txt --single-version-externally-managed --compile --install-headers /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/include/site/python3.8/opendr
         cwd: /tmp/pip-install-qq_lrcqv/opendr/
    Complete output (68 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/cvwrap.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/geometry.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/slider_demo.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/occlusion_test.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/filters.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/common.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/version.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/everything.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/simple.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/lighting.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/utils.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/util_tests.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_depth_renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/serialization.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/__init__.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_camera.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/renderer.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/test_sh.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/dummy.py -> build/lib.linux-x86_64-3.8/opendr
    copying opendr/topology.py -> build/lib.linux-x86_64-3.8/opendr
    creating build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_3_2.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/fix_warnings.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/autogen.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/_constants.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/__init__.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    copying opendr/contexts/draw_triangle_shaders_2_1.py -> build/lib.linux-x86_64-3.8/opendr/contexts
    creating build/lib.linux-x86_64-3.8/opendr/test_dr
    copying opendr/test_dr/__init__.py -> build/lib.linux-x86_64-3.8/opendr/test_dr
    running build_ext
    building 'opendr.contexts.ctx_mesa' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/opendr
    creating build/temp.linux-x86_64-3.8/opendr/contexts
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -D__OSMESA__=1 -Iopendr/contexts -I. -I/home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include -Iopendr/contexts/OSMesa/include -I/home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/include -I/usr/include/python3.8 -c opendr/contexts/ctx_mesa.c -o build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -lstdc++
    In file included from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832,
                     from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from opendr/contexts/ctx_mesa.c:657:
    /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       17 | #warning "Using deprecated NumPy API, disable it with " \
          |  ^~~~~~~
    opendr/contexts/ctx_mesa.c: In function ‘__pyx_pf_6opendr_8contexts_8ctx_mesa_13OsContextBase_150ShaderSource’:
    opendr/contexts/ctx_mesa.c:13169:50: warning: passing argument 3 of ‘glShaderSource’ from incompatible pointer type [-Wincompatible-pointer-types]
    13169 |   glShaderSource(__pyx_v_shader, __pyx_v_count, (&__pyx_v_s), (&__pyx_v_len));
          |                                                 ~^~~~~~~~~~~
          |                                                  |
          |                                                  char **
    In file included from opendr/contexts/OSMesa/include/GL/gl.h:2085,
                     from opendr/contexts/gl_includes.h:10,
                     from opendr/contexts/ctx_mesa.c:659:
    opendr/contexts/OSMesa/include/GL/glext.h:5794:82: note: expected ‘const GLchar **’ {aka ‘const char **’} but argument is of type ‘char **’
     5794 | GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
          |                                                                   ~~~~~~~~~~~~~~~^~~~~~
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/opendr/contexts/ctx_mesa.o -Lopendr/contexts/OSMesa/lib -lOSMesa -lGL -lGLU -o build/lib.linux-x86_64-3.8/opendr/contexts/ctx_mesa.cpython-38-x86_64-linux-gnu.so -lstdc++
    /usr/bin/ld: cannot find -lOSMesa
    /usr/bin/ld: cannot find -lGLU
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-qq_lrcqv/opendr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0e9ez2_r/install-record.txt --single-version-externally-managed --compile --install-headers /home/bengt/Downloads/Projekte/github.com/ZhengZerong/DeepHuman/venv/include/site/python3.8/opendr Check the logs for full command output.

Parameters to gaussian_pyramid

The parameter normalization to opendr.filters.gaussian_pyramid is parsed incorrectly; it should be compared using == instead of is. This causes weird behavior when using the function:

gaussian_pyramid(..., normalization='SSE') # works
gaussian_pyramid(..., normalization='SSEE'[:3]) # fails, throws TypeError

ch.linalg.svd not working in stacked mode

Moved to chumpy Issues!

From numpy doc:

If a has more than two dimensions, then broadcasting rules apply [...]. This means that SVD is working in “stacked” mode: it iterates over all indices of the first a.ndim - 2 dimensions and for each combination SVD is applied to the last two indices.

https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.svd.html

When calculating the derivatives for SVD chumpy assumes 2D arrays:

line 196 of linalg.py:

result = np.einsum('ik,jk->kij', u, v)

line 214ff of linalg.py

mxsz = max(shp[0], shp[1])
D = np.zeros(mxsz)
D[:_D.size] = _D

The only workaround I see right now is looping over the dimensions outside of SVD (slow).

Error in installtion pip install opendr

pip install opendr
Collecting opendr
Using cached opendr-0.78.tar.gz (581 kB)
Collecting Cython
Downloading Cython-0.29.21-cp37-cp37m-win_amd64.whl (1.6 MB)
|████████████████████████████████| 1.6 MB 2.2 MB/s
Requirement already satisfied: chumpy>=0.58 in c:\users\microsoft\anaconda3\envs\smpl\lib\site-packages (from opendr) (0.70)
Collecting matplotlib
Downloading matplotlib-3.3.3-cp37-cp37m-win_amd64.whl (8.5 MB)
|████████████████████████████████| 8.5 MB 2.2 MB/s
Requirement already satisfied: scipy>=0.13.0 in c:\users\microsoft\anaconda3\envs\smpl\lib\site-packages (from chumpy>=0.58->opendr) (1.5.4)
Requirement already satisfied: six>=1.11.0 in c:\users\microsoft\anaconda3\envs\smpl\lib\site-packages (from chumpy>=0.58->opendr) (1.15.0)
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.3.1-cp37-cp37m-win_amd64.whl (51 kB)
|████████████████████████████████| 51 kB 45 kB/s
Requirement already satisfied: numpy>=1.15 in c:\users\microsoft\anaconda3\envs\smpl\lib\site-packages (from matplotlib->opendr) (1.19.2)
Collecting cycler>=0.10
Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting python-dateutil>=2.1
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
|████████████████████████████████| 227 kB 3.3 MB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 2.8 MB/s
Collecting pillow>=6.2.0
Downloading Pillow-8.0.1-cp37-cp37m-win_amd64.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 6.4 MB/s
Building wheels for collected packages: opendr
Building wheel for opendr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Microsoft\anaconda3\envs\smpl\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"'; file='"'"'C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\MICROS1\AppData\Local\Temp\pip-wheel-ikfwfhnn'
cwd: C:\Users\MICROS
1\AppData\Local\Temp\pip-install-f_tuhisg\opendr
Complete output (55 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\opendr
copying opendr\camera.py -> build\lib.win-amd64-3.7\opendr
copying opendr\common.py -> build\lib.win-amd64-3.7\opendr
copying opendr\cvwrap.py -> build\lib.win-amd64-3.7\opendr
copying opendr\dummy.py -> build\lib.win-amd64-3.7\opendr
copying opendr\everything.py -> build\lib.win-amd64-3.7\opendr
copying opendr\filters.py -> build\lib.win-amd64-3.7\opendr
copying opendr\geometry.py -> build\lib.win-amd64-3.7\opendr
copying opendr\lighting.py -> build\lib.win-amd64-3.7\opendr
copying opendr\occlusion_test.py -> build\lib.win-amd64-3.7\opendr
copying opendr\renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\serialization.py -> build\lib.win-amd64-3.7\opendr
copying opendr\simple.py -> build\lib.win-amd64-3.7\opendr
copying opendr\slider_demo.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_camera.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_depth_renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_geometry.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_sh.py -> build\lib.win-amd64-3.7\opendr
copying opendr\topology.py -> build\lib.win-amd64-3.7\opendr
copying opendr\utils.py -> build\lib.win-amd64-3.7\opendr
copying opendr\util_tests.py -> build\lib.win-amd64-3.7\opendr
copying opendr\version.py -> build\lib.win-amd64-3.7\opendr
copying opendr_init_.py -> build\lib.win-amd64-3.7\opendr
creating build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\autogen.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\draw_triangle_shaders_2_1.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\draw_triangle_shaders_3_2.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\fix_warnings.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts_constants.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts_init_.py -> build\lib.win-amd64-3.7\opendr\contexts
creating build\lib.win-amd64-3.7\opendr\test_dr
copying opendr\test_dr_init_.py -> build\lib.win-amd64-3.7\opendr\test_dr
running build_ext
building 'opendr.contexts.ctx_mesa' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\opendr
creating build\temp.win-amd64-3.7\Release\opendr\contexts
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__OSMESA__=1 -I. -IC:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\numpy\core\include -Iopendr/contexts/OSMesa/include -IC:\Users\Microsoft\anaconda3\envs\smpl\include -IC:\Users\Microsoft\anaconda3\envs\smpl\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcopendr/contexts/ctx_mesa.c /Fobuild\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj -lstdc++
cl : Command line warning D9002 : ignoring unknown option '-lstdc++'
ctx_mesa.c
C:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
opendr/contexts/ctx_mesa.c(6887): warning C4244: 'function': conversion from 'npy_intp' to 'GLint', possible loss of data
opendr/contexts/ctx_mesa.c(26245): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
opendr/contexts/ctx_mesa.c(26251): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:opendr/contexts/OSMesa/lib /LIBPATH:C:\Users\Microsoft\anaconda3\envs\smpl\libs /LIBPATH:C:\Users\Microsoft\anaconda3\envs\smpl\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" OSMesa.lib GL.lib GLU.lib /EXPORT:PyInit_ctx_mesa build\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj /OUT:build\lib.win-amd64-3.7\opendr\contexts\ctx_mesa.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\opendr/contexts\ctx_mesa.cp37-win_amd64.lib -lstdc++
LINK : warning LNK4044: unrecognized option '/lstdc++'; ignored
LINK : fatal error LNK1181: cannot open input file 'OSMesa.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe' failed with exit status 1181

ERROR: Failed building wheel for opendr
Running setup.py clean for opendr
Failed to build opendr
Installing collected packages: Cython, kiwisolver, cycler, python-dateutil, pyparsing, pillow, matplotlib, opendr
Running setup.py install for opendr ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Microsoft\anaconda3\envs\smpl\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"'; file='"'"'C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\MICROS1\AppData\Local\Temp\pip-record-k_v2ywh2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Microsoft\anaconda3\envs\smpl\Include\opendr'
cwd: C:\Users\MICROS
1\AppData\Local\Temp\pip-install-f_tuhisg\opendr
Complete output (57 lines):
Compiling opendr/contexts/ctx_mesa.pyx because it depends on C:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\Cython\Includes\libc\string.pxd.
[1/1] Cythonizing opendr/contexts/ctx_mesa.pyx
C:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\opendr\contexts\ctx_mesa.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\opendr
copying opendr\camera.py -> build\lib.win-amd64-3.7\opendr
copying opendr\common.py -> build\lib.win-amd64-3.7\opendr
copying opendr\cvwrap.py -> build\lib.win-amd64-3.7\opendr
copying opendr\dummy.py -> build\lib.win-amd64-3.7\opendr
copying opendr\everything.py -> build\lib.win-amd64-3.7\opendr
copying opendr\filters.py -> build\lib.win-amd64-3.7\opendr
copying opendr\geometry.py -> build\lib.win-amd64-3.7\opendr
copying opendr\lighting.py -> build\lib.win-amd64-3.7\opendr
copying opendr\occlusion_test.py -> build\lib.win-amd64-3.7\opendr
copying opendr\renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\serialization.py -> build\lib.win-amd64-3.7\opendr
copying opendr\simple.py -> build\lib.win-amd64-3.7\opendr
copying opendr\slider_demo.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_camera.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_depth_renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_geometry.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_renderer.py -> build\lib.win-amd64-3.7\opendr
copying opendr\test_sh.py -> build\lib.win-amd64-3.7\opendr
copying opendr\topology.py -> build\lib.win-amd64-3.7\opendr
copying opendr\utils.py -> build\lib.win-amd64-3.7\opendr
copying opendr\util_tests.py -> build\lib.win-amd64-3.7\opendr
copying opendr\version.py -> build\lib.win-amd64-3.7\opendr
copying opendr_init_.py -> build\lib.win-amd64-3.7\opendr
creating build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\autogen.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\draw_triangle_shaders_2_1.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\draw_triangle_shaders_3_2.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts\fix_warnings.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts_constants.py -> build\lib.win-amd64-3.7\opendr\contexts
copying opendr\contexts_init_.py -> build\lib.win-amd64-3.7\opendr\contexts
creating build\lib.win-amd64-3.7\opendr\test_dr
copying opendr\test_dr_init_.py -> build\lib.win-amd64-3.7\opendr\test_dr
running build_ext
building 'opendr.contexts.ctx_mesa' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\opendr
creating build\temp.win-amd64-3.7\Release\opendr\contexts
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__OSMESA__=1 -Iopendr/contexts -I. -IC:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\numpy\core\include -Iopendr/contexts/OSMesa/include -IC:\Users\Microsoft\anaconda3\envs\smpl\include -IC:\Users\Microsoft\anaconda3\envs\smpl\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /Tcopendr/contexts/ctx_mesa.c /Fobuild\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj -lstdc++
cl : Command line warning D9002 : ignoring unknown option '-lstdc++'
ctx_mesa.c
C:\Users\Microsoft\anaconda3\envs\smpl\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
opendr/contexts/ctx_mesa.c(7070): warning C4244: 'function': conversion from 'npy_intp' to 'GLint', possible loss of data
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:opendr/contexts/OSMesa/lib /LIBPATH:C:\Users\Microsoft\anaconda3\envs\smpl\libs /LIBPATH:C:\Users\Microsoft\anaconda3\envs\smpl\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64" OSMesa.lib GL.lib GLU.lib /EXPORT:PyInit_ctx_mesa build\temp.win-amd64-3.7\Release\opendr/contexts/ctx_mesa.obj /OUT:build\lib.win-amd64-3.7\opendr\contexts\ctx_mesa.cp37-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.7\Release\opendr/contexts\ctx_mesa.cp37-win_amd64.lib -lstdc++
LINK : warning LNK4044: unrecognized option '/lstdc++'; ignored
LINK : fatal error LNK1181: cannot open input file 'OSMesa.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Microsoft\anaconda3\envs\smpl\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\MICROS
1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"'; file='"'"'C:\Users\MICROS1\AppData\Local\Temp\pip-install-f_tuhisg\opendr\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\MICROS1\AppData\Local\Temp\pip-record-k_v2ywh2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Microsoft\anaconda3\envs\smpl\Include\opendr' Check the logs for full command output.

what's the intrinsic of camera

It seems that we don't need set camera intrinsic parameters when use ProjectPoints to render. Is this because of fixed intrinsic parameters? If yes, can you share these parameters? Because I have to know these parameter to make a proper projection image.

some question about notation

hi i'd like to ask that what does
dterms = 'v', 'rt', 't', 'f', 'c', 'k'
in
class ProjectPoints(Ch):
means
and hopefully could you please tell me how to look up for the reference book?because currently i can only find 2 tutorials?
thanks.

Retrieve visible vertices

Not really an issue, more of a question. Is there a way to retrieve the visible from a given viewpoint vertices?

Installation failing with -lOSMesa

It seems today I am unable to install opendr. I've not had trouble with it in the past. When I install with pip, it gives the error /usr/bin/ld: cannot find -lOSMesa collect2: error: ld returned 1 exit status.

Also, I noticed that the mesa website seems to be down:
https://www.mesa3d.org/osmesa.html

Perhaps these two issues are linked? Has anyone else had this issue, and if so, what is the workaround?

Thanks!
Henry C.

'numpy.float64' object cannot be interpreted as an integer

when my code goes to
ch.minimize( 'pyr': E_pyr), x0=free_variables, callback=cb) in optimization demo,
the error says the 'pyr': E_pyr is float object not integer(which is needed).
But when I look up the definition of minimize function, it does not mention the type of the first parameter.

Has someone met this problem??

the problem of "ImportError: No module named ctx_mesa"

pip install opendr==0.77, and it is successfully. Then, enter into the environment of python, input the test of demo "import opendr
opendr.demo('spherical_harmonics')".
But the error is as below:
"Traceback (most recent call last):
File "", line 1, in
File "opendr/init.py", line 350, in demo
exec('global np\n' + demos[which], globals(), locals())
File "", line 5, in
File "opendr/renderer.py", line 25, in
from .contexts.ctx_mesa import OsContext
ImportError: No module named ctx_mesa"

test_renderer fails

Hi,

I try test_renderer and I get the following error,

test_cam_derivatives (main.TestRenderer) ... ERROR
test_color_derivatives (main.TestRenderer) ... ERROR
test_distortion (main.TestRenderer) ... ERROR
test_lightpos_derivatives (main.TestRenderer) ... ERROR
test_pyramids (main.TestRenderer)
Test that pyramid construction doesn't crash. No quality testing here. ... ERROR
test_vert_derivatives (main.TestRenderer) ... ERROR

======================================================================
ERROR: test_cam_derivatives (main.TestRenderer)

Traceback (most recent call last):
File "test_renderer.py", line 213, in test_cam_derivatives
r = renderer.r
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 594, in r
self._call_on_changed()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 320, in on_changed
self.glf = OsContext(w, h, typ=GL_FLOAT)
File "contexts/ctx_mesa.pyx", line 62, in contexts.ctx_mesa.OsContextRaw.init
self.image = np.zeros((h,w,3), dtype=np.float32)
TypeError: 'float' object cannot be interpreted as an index

======================================================================
ERROR: test_color_derivatives (main.TestRenderer)

Traceback (most recent call last):
File "test_renderer.py", line 434, in test_color_derivatives
r = renderer.r
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 594, in r
self._call_on_changed()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 320, in on_changed
self.glf = OsContext(w, h, typ=GL_FLOAT)
File "contexts/ctx_mesa.pyx", line 62, in contexts.ctx_mesa.OsContextRaw.init
self.image = np.zeros((h,w,3), dtype=np.float32)
TypeError: 'float' object cannot be interpreted as an index

======================================================================
ERROR: test_distortion (main.TestRenderer)

Traceback (most recent call last):
File "test_renderer.py", line 125, in test_distortion
im_original = renderer.r.copy()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 594, in r
self._call_on_changed()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 470, in on_changed
super(TexturedRenderer, self).on_changed(which)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 320, in on_changed
self.glf = OsContext(w, h, typ=GL_FLOAT)
File "contexts/ctx_mesa.pyx", line 62, in contexts.ctx_mesa.OsContextRaw.init
self.image = np.zeros((h,w,3), dtype=np.float32)
TypeError: 'float' object cannot be interpreted as an index

======================================================================
ERROR: test_lightpos_derivatives (main.TestRenderer)

Traceback (most recent call last):
File "test_renderer.py", line 364, in test_lightpos_derivatives
dr = renderer.dr_wrt(light1_pos).copy()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 732, in dr_wrt
self._call_on_changed()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 320, in on_changed
self.glf = OsContext(w, h, typ=GL_FLOAT)
File "contexts/ctx_mesa.pyx", line 62, in contexts.ctx_mesa.OsContextRaw.init
self.image = np.zeros((h,w,3), dtype=np.float32)
TypeError: 'float' object cannot be interpreted as an index

======================================================================
ERROR: test_pyramids (main.TestRenderer)
Test that pyramid construction doesn't crash. No quality testing here.

Traceback (most recent call last):
File "test_renderer.py", line 93, in test_pyramids
rn_pyr = gaussian_pyramid(rn, normalization=None, n_levels=2)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/filters.py", line 71, in gaussian_pyramid
cur_imshape = cur_obj.output_shape
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/filters.py", line 114, in output_shape
self._call_on_changed() # trigger changes from im_shape
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/filters.py", line 102, in on_changed
self.transf_mtx, self._output_shape = filter_for_nopadding(sh, self.kernel)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/filters.py", line 180, in filter_for_nopadding
xs = np.tile(np.arange(old_w), (old_h, 1))
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/numpy/lib/shape_base.py", line 1157, in tile
return c.reshape(shape_out)
TypeError: 'float' object cannot be interpreted as an index

======================================================================
ERROR: test_vert_derivatives (main.TestRenderer)

Traceback (most recent call last):
File "test_renderer.py", line 293, in test_vert_derivatives
r = renderer.r
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 594, in r
self._call_on_changed()
File "/home/mohammad/anaconda2/lib/python2.7/site-packages/chumpy/ch.py", line 589, in _call_on_changed
self.on_changed(self._dirty_vars)
File "/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/renderer.py", line 320, in on_changed
self.glf = OsContext(w, h, typ=GL_FLOAT)
File "contexts/ctx_mesa.pyx", line 62, in contexts.ctx_mesa.OsContextRaw.init
self.image = np.zeros((h,w,3), dtype=np.float32)
TypeError: 'float' object cannot be interpreted as an index


Ran 6 tests in 0.779s

FAILED (errors=6)
--Return--

/media/mohammad/D43ADD7F3ADD5ED4/Mohammad/RelightingDynamic/SMPL-dataset/smpl-python/opendr/test_renderer.py(496)()->None
-> import pdb; pdb.set_trace()
(Pdb) q
Traceback (most recent call last):
File "test_renderer.py", line 496, in
import pdb; pdb.set_trace()
File "/home/mohammad/anaconda2/lib/python2.7/bdb.py", line 53, in trace_dispatch
return self.dispatch_return(frame, arg)
File "/home/mohammad/anaconda2/lib/python2.7/bdb.py", line 91, in dispatch_return
if self.quitting: raise BdbQuit
bdb.BdbQuit

I am using anaconda python 2.7, ubuntu 18.04 64bit

opendr.demo('point_light') produce black image

I am using Ubuntu 18.04, CUDA 10.1 Python 2.7.15. The following issue does not happen in any other machines in my lab but they are Ubuntu 16.

I have followed instructions on https://github.com/mattloper/opendr/wiki/Installation-in-Ubuntu

I then run opendr.demo('point_light'), but only a black image comes up, not the sphere mesh with one point light source. Here is the error message:


Create renderer
import chumpy as ch
from opendr.renderer import ColoredRenderer
from opendr.lighting import LambertianPointLight
rn = ColoredRenderer()

Assign attributes to renderer
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))

Construct point light source
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.]))

Show it
import matplotlib.pyplot as plt
plt.ion()
plt.imshow(rn.r)
plt.show()

dr = rn.dr_wrt(rn.v) # or rn.vc, or rn.camera.rt, rn.camera.t, rn.camera.f, rn.camera.c, etc


I also cannot get the opendr.demo('optimization') running:

from opendr.simple import *
import numpy as np
import matplotlib.pyplot as plt
w, h = 320, 240

try:
m = load_mesh('earth.obj')
except:
from opendr.util_tests import get_earthmesh
m = get_earthmesh(trans=ch.array([0,0,0]), rotation=ch.zeros(3))

Create V, A, U, f: geometry, brightness, camera, renderer
V = ch.array(m.v)
A = SphericalHarmonics(vn=VertNormals(v=V, f=m.f),
components=[3.,2.,0.,0.,0.,0.,0.,0.,0.],
light_color=ch.ones(3))
U = ProjectPoints(v=V, f=[w,w], c=[w/2.,h/2.], k=ch.zeros(5),
t=ch.zeros(3), rt=ch.zeros(3))
f = TexturedRenderer(vc=A, camera=U, f=m.f, bgcolor=[0.,0.,0.],
texture_image=m.texture_image, vt=m.vt, ft=m.ft,
frustum={'width':w, 'height':h, 'near':1,'far':20})

Parameterize the vertices
translation, rotation = ch.array([0,0,8]), ch.zeros(3)
f.v = translation + V.dot(Rodrigues(rotation))

observed = f.r
np.random.seed(1)
translation[:] = translation.r + np.random.rand(3)
rotation[:] = rotation.r + np.random.rand(3) *.2
A.components[1:] = 0

Create the energy
E_raw = f - observed
E_pyr = gaussian_pyramid(E_raw, n_levels=6, normalization='size')

def cb(_):
import cv2
cv2.imshow('Absolute difference', np.abs(E_raw.r))
cv2.waitKey(1)

print 'OPTIMIZING TRANSLATION, ROTATION, AND LIGHT PARMS'
free_variables=[translation, rotation, A.components]
ch.minimize({'pyr': E_pyr}, x0=free_variables, callback=cb)
ch.minimize({'raw': E_raw}, x0=free_variables, callback=cb)

OPTIMIZING TRANSLATION, ROTATION, AND LIGHT PARMS
0.00e+00 | pyr: 0.00e+00
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/opendr/init.py", line 350, in demo
exec('global np\n' + demos[which], globals(), locals())
File "", line 48, in
File "/home/yifu/.local/lib/python2.7/site-packages/chumpy/optimization.py", line 41, in minimize
return minimize_dogleg(fun, free_variables=x0, on_step=callback, **options)
File "/home/yifu/.local/lib/python2.7/site-packages/chumpy/optimization_internal.py", line 408, in minimize_dogleg
state.updateJ(obj)
File "/home/yifu/.local/lib/python2.7/site-packages/chumpy/optimization_internal.py", line 311, in updateJ
assert(self.J.nnz > 0)
AssertionError

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.