Giter Site home page Giter Site logo

opendr's People

Contributors

polmorenoc 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

opendr's Issues

ColoreRendere:draw_color_image

argument2 of reshape are both same as 'height'

result = np.flipud(np.frombuffer(GL.glReadPixels( 0,0, self.frustum['width'], self.frustum['height'], GL.GL_RGB, GL.GL_UNSIGNED_BYTE), np.uint8).reshape(self.frustum['height'],self.frustum['height'],3).astype(np.float64))/255.0

I think correct is .reshape(self.frustum['width'],self.frustum['height'],3).

AttributeError: module 'chumpy.ch' has no attribute 'tensordot'

Hi, I've tried a few things, but it does seem, unfortunately, that the issue is somewhere in your chumpy installation.

Here is my stacktrace:

python3

Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import chumpy
Traceback (most recent call last):
File "", line 1, in
File "/home/n/anaconda3/envs/cat4/lib/python3.6/site-packages/chumpy/init.py", line 2, in
from chumpy.ch import *
AttributeError: module 'chumpy.ch' has no attribute 'tensordot'

And here is more system info:

Operating System:
Ubuntu 16.04

output of uname -a:
Linux elon-eats-my-shorts 4.15.0-46-generic #49~16.04.1-Ubuntu SMP Tue Feb 12 17:45:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I am using a conda environment, which may be causing part of the problem.

output of conda list:
absl-py 0.7.0 pypi_0 pypi
astor 0.7.1 pypi_0 pypi
blas 1.0 mkl
bzip2 1.0.6 h14c3975_5
ca-certificates 2019.1.23 0
cairo 1.14.12 h8948797_3
certifi 2018.11.29 py36_0
chumpy 0.66 pypi_0 pypi
cloudpickle 0.8.0 py36_0 anaconda
cycler 0.10.0 py36_0
cython 0.29.6 pypi_0 pypi
cytoolz 0.9.0.1 py36h14c3975_1 anaconda
dask-core 1.1.2 py_0 anaconda
dbus 1.13.6 h746ee38_0
decorator 4.3.2 py36_0 anaconda
expat 2.2.6 he6710b0_0
fastcache 1.0.2 py36h14c3975_2
ffmpeg 4.0 hcdf2ecd_0
fontconfig 2.13.0 h9420a91_0
freeglut 3.0.0 hf484d3e_5
freetype 2.9.1 h8a8886c_1
gast 0.2.2 pypi_0 pypi
glfw 1.7.1 pypi_0 pypi
glib 2.56.2 hd408876_0
gmp 6.1.2 h6c8ec71_1
gmpy2 2.0.8 py36h10f8cd9_2
graphite2 1.3.13 h23475e2_0
grpcio 1.19.0 pypi_0 pypi
gst-plugins-base 1.14.0 hbbd80ab_1
gstreamer 1.14.0 hb453b48_1
h5py 2.9.0 pypi_0 pypi
harfbuzz 1.8.8 hffaf4a1_0
hdf5 1.10.2 hba1933b_1
icu 58.2 h9c2bf20_1
imageio 2.5.0 py36_0 anaconda
intel-openmp 2019.1 144
jasper 2.0.14 h07fcdf6_1
jpeg 9b h024ee3a_2
keras-applications 1.0.7 pypi_0 pypi
keras-preprocessing 1.0.9 pypi_0 pypi
kiwisolver 1.0.1 py36hf484d3e_0
libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 8.2.0 hdf63c60_1
libgfortran-ng 7.3.0 hdf63c60_0
libglu 9.0.0 hf484d3e_1
libopencv 3.4.2 hb342d67_1
libopus 1.3 h7b6447c_0
libpng 1.6.36 hbc83047_0
libstdcxx-ng 8.2.0 hdf63c60_1
libtiff 4.0.10 h2733197_2
libuuid 1.0.3 h1bed415_2
libvpx 1.7.0 h439df22_0
libxcb 1.13 h1bed415_1
libxml2 2.9.9 he19cac6_0
markdown 3.0.1 pypi_0 pypi
matplotlib 2.2.3 py36hb69df0a_0
mkl 2019.1 144
mkl_fft 1.0.10 py36ha843d7b_0
mkl_random 1.0.2 py36hd81dba3_0
mpc 1.1.0 h10f8cd9_1
mpfr 4.0.1 hdf1c602_3
mpmath 1.1.0 py36_0
ncurses 6.1 he6710b0_1
networkx 2.2 py36_1 anaconda
numpy 1.16.2 pypi_0 pypi
numpy-base 1.16.2 py36hde5b4d6_0
olefile 0.46 py36_0 anaconda
opencv 3.4.2 py36h6fd60c2_1
opendr 0.73 pypi_0 pypi
openssl 1.1.1b h7b6447c_0
pcre 8.42 h439df22_0
pillow 5.4.1 py36h34e0f95_0 anaconda
pip 9.0.0 pypi_0 pypi
pixman 0.36.0 h7b6447c_0
protobuf 3.7.0 pypi_0 pypi
py-opencv 3.4.2 py36hb342d67_1
pyopengl 3.1.0 pypi_0 pypi
pyopengl-accelerate 3.1.0 pypi_0 pypi
pyparsing 2.3.1 py36_0
pyqt 5.9.2 py36h05f1152_2
python 3.6.8 h0371630_0
python-dateutil 2.8.0 py36_0
pytz 2018.9 py36_0
pywavelets 1.0.1 py36hdd07704_0 anaconda
qt 5.9.7 h5867ecd_1
readline 7.0 h7b6447c_5
scikit-image 0.14.2 pypi_0 pypi
scipy 1.2.1 py36h7c811a0_0 anaconda
setuptools 40.8.0 pypi_0 pypi
sip 4.19.8 py36hf484d3e_0
six 1.12.0 pypi_0 pypi
sqlite 3.26.0 h7b6447c_0
sympy 1.3 py36_0
tensorboard 1.12.2 pypi_0 pypi
tensorflow 1.12.0 pypi_0 pypi
termcolor 1.1.0 pypi_0 pypi
tk 8.6.8 hbc83047_0
toolz 0.9.0 py36_0 anaconda
tornado 5.1.1 py36h7b6447c_0
werkzeug 0.14.1 pypi_0 pypi
wheel 0.33.1 pypi_0 pypi
xz 5.2.4 h14c3975_4
zlib 1.2.11 h7b6447c_3
zstd 1.3.7 h0b5b093_0

output of pip freeze:
absl-py==0.7.0
astor==0.7.1
certifi==2018.11.29
chumpy==0.66
cloudpickle==0.8.0
cycler==0.10.0
Cython==0.29.6
cytoolz==0.9.0.1
dask==1.1.2
decorator==4.3.2
fastcache==1.0.2
gast==0.2.2
glfw==1.7.1
gmpy2==2.0.8
grpcio==1.19.0
h5py==2.9.0
imageio==2.5.0
Keras-Applications==1.0.7
Keras-Preprocessing==1.0.9
kiwisolver==1.0.1
Markdown==3.0.1
matplotlib==2.2.3
mkl-fft==1.0.10
mkl-random==1.0.2
mpmath==1.1.0
networkx==2.2
numpy==1.16.2
olefile==0.46
opendr==0.73
Pillow==5.4.1
protobuf==3.7.0
PyOpenGL==3.1.0
PyOpenGL-accelerate==3.1.0
pyparsing==2.3.1
python-dateutil==2.8.0
pytz==2018.9
PyWavelets==1.0.1
scikit-image==0.14.2
scipy==1.2.1
six==1.12.0
sympy==1.3
tensorboard==1.12.2
tensorflow==1.12.0
termcolor==1.1.0
toolz==0.9.0
tornado==5.1.1
Werkzeug==0.14.1

If I can provide any further information, please let me know. Thank you for your time :)

DepthRenderer

I am not able to use DepthRenderer as there is no such sub module, can you please help me out?

Faster gradient computation

Thank you for releasing this!
OpenDR uses chumpy for gradient computations which (if I am not wrong) run on CPU, is there a way to accelerate this? Have you tried to move this to Tensorflow, PyTorch or some other framework?

Problem with ColoredRenderer and TexturedRenderer

Hi,
I've just downloaded the modern opendr library as I'm hoping to accelerate fitting SMPL to some data points. However, I'm having trouble getting the ColoredRenderer and TexturedRenderer to work properly.

For me, the demo code found in this repo at 'opendr/opendr/init.py' results in an error:

import chumpy as ch
from opendr.renderer import TexturedRenderer
rn = TexturedRenderer()

# 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, vc=m.vc, texture_image=m.texture_image, ft=m.ft, vt=m.vt)

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

Error message:

Traceback (most recent call last):
  File "earth_renderer.py", line 17, in <module>
    plt.imshow(rn.r)
  File "/scratch/bjb56/download/opendr/chumpy/ch.py", line 555, in r
    self._call_on_changed()
  File "/scratch/bjb56/download/opendr/chumpy/ch.py", line 550, in _call_on_changed
    self.on_changed(self._dirty_vars)
  File "/scratch/bjb56/download/opendr/opendr/renderer.py", line 1422, in on_changed
    super().on_changed(which)
  File "/scratch/bjb56/download/opendr/opendr/renderer.py", line 948, in on_changed
    self.vbo_verts_face.set_array(np.array(self.verts_by_face).astype(np.float32))
AttributeError: 'TexturedRenderer' object has no attribute 'vbo_verts_face'

A simpler variant of this with the ColoredRenderer also results in an error. I'm happy to post this too if needed.

Would be grateful if you could advise here.

Thanks,

Ben

How to install this opendr for python3

hello, thank your work . As I didn’t touch thsee for a long time, I have no idea how to install it to my conda virtual environment.Could you give some detials on how to install it ?Thank you very much.

demo_fit_cube.py terminates early.

I ran the demo_fit_cube.py and the code terminates just early.
The console output looks as,

Machine precision = 2.220D-16
N =            3     M =           10
This problem is unconstrained.

At X0         0 variables are exactly at the bounds

At iterate    0    f= -5.67081D-02    |proj g|=  4.96139D+00

At iterate    1    f= -2.44916D-01    |proj g|=  4.96139D+00
ys= 0.000E+00  -gs= 3.852E-01 BFGS update SKIPPED

            * * *

Tit   = total number of iterations
Tnf   = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip  = number of BFGS updates skipped
Nact  = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F     = final function value

       * * *

   N    Tit     Tnf  Tnint  Skip  Nact     Projg        F
    3      2     29      2     1     0   4.961D+00  -2.449D-01
  F = -0.24491614386444571     

ABNORMAL_TERMINATION_IN_LNSRCH                              

 Line search cannot locate an adequate point after 20 function
 and gradient evaluations.  Previous x, f and g restored.
 Possible causes: 1 error in function or gradient evaluation;
              2 rounding error dominate computation.

 Cauchy                time 0.000E+00 seconds.
 Subspace minimization time 0.000E+00 seconds.
 Line search           time 0.000E+00 seconds.

 Total User time 0.000E+00 seconds.

About this work

@polmorenoc Hello, and all other fellows. May be my skills and understanding are poor, but, i have a question for my knowledge. As, far as, I understand opendr is library with many different functions for differentiation and 3d mesh rendering, now, we install this library in our virtual environment to efficiently use all its functions. However, in your provided functions, i dont know how to install these functions for whether they require installation or not. I simply understood that i should install openGL and GLFW and then use you provided python scripts to perform the operations and functions what i require, is it? If this is the situation then there are many other functions in opendr,,,how, we can perform those operations with your scripts?

'ColoredRenderer' object has no attribute 'vbo_verts_face'

  File "/home/xumingkai/.local/lib/python3.6/site-packages/chumpy/ch.py", line 555, in r
    self._call_on_changed()
  File "/home/xumingkai/.local/lib/python3.6/site-packages/chumpy/ch.py", line 550, in _call_on_changed
    self.on_changed(self._dirty_vars)
  File "/home/xumingkai/.local/lib/python3.6/site-packages/opendr/renderer.py", line 1080, in on_changed
    self.vbo_verts_face.set_array(np.array(self.verts_by_face).astype(np.float32))
AttributeError: 'ColoredRenderer' object has no attribute 'vbo_verts_face'

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.