Git Product home page Git Product logo

differentiable-renderer's Introduction

Differentiable mesh renderer [Tensorflow]

Rastering algorithm to approximate the rendering of a 3D model silhouette in a fully differentiable way.

➡️ PyTorch implementation now available in the pytorch branch!


This code accompanies the paper:

"End-to-end 6-DoF Object Pose Estimation through Differentiable Rasterization"

Andrea Palazzi, Luca Bergamini, Simone Calderara, Rita Cucchiara

appeared in "Second Workshop on 3D Reconstruction Meets Semantics (3DRMS)" at ECCVW 2018.

Rotation on Y axis
Rendering while rotating the camera around Y axis.

Rotation on Z axis
Rendering while rotating the camera around Z axis.


Docs

Input meshes

The input meshes are expected to be np.ndarray of shape (n_triangles, 3, 3). Each mesh can be composed of a variable number of triangles. Five meshes of car 3D models are already in data/ directory to test the Rasterer.

Hello World

A short snippet to test the Rasterer is available in main.py. Just run it.

Three 3D models are randomly sampled from the dummy dataset and rendered in a batch. In this snippet the position of the camera is kept fixed for all three (but it may be changed).

If everything went fine, you should see the rendering output for the 3D models sampled. Something like this:

render_output
Output with resolution=(128, 128)

Moving the camera in the 3D world

There is a class RotoTranslation which encapsulates the camera matrix, providing an easy way to change the camera location while always mantaining a geometrically consistent pose.

The initial camera pose is set as:

camera_pose = RotoTranslation(rotation=Vector(x=90., y=0., z=0.),
                              translation=Vector(x=0., y=-8., z=0.),
                              angle_unit='degrees')

To change its position, simply use its setters:

  • alpha_x, alpha_y, alpha_z to change the rotation angle around respective axes
  • t_x, t_y, t_z to change the translation along respective axes

License

This code is released under MIT license. In case you use this code in your academic work, please cite the following paper:

@inproceedings{palazzi2018end,
  title={End-to-end 6-DoF Object Pose Estimation through Differentiable Rasterization},
  author={Palazzi, Andrea and Bergamini, Luca and Calderara, Simone and Cucchiara, Rita},
  booktitle={Second Workshop on 3D Reconstruction Meets Semantics (3DRMS)},
  year={2018}
}

differentiable-renderer's People

Contributors

ndrplz avatar

Watchers

James Cloos avatar

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.