https://github.com/andrewkchan/pytorch_mesh_renderer
Some implementations of differentiable 3D mesh renderers using PyTorch with examples
https://github.com/andrewkchan/pytorch_mesh_renderer
differentiable-rendering graphics machine-learning pytorch
Last synced: 10 months ago
JSON representation
Some implementations of differentiable 3D mesh renderers using PyTorch with examples
- Host: GitHub
- URL: https://github.com/andrewkchan/pytorch_mesh_renderer
- Owner: andrewkchan
- Created: 2019-07-11T01:28:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T06:36:21.000Z (over 2 years ago)
- Last Synced: 2025-04-04T20:06:28.859Z (about 1 year ago)
- Topics: differentiable-rendering, graphics, machine-learning, pytorch
- Language: Python
- Homepage:
- Size: 1.34 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
This repository contains implementations of two differentiable 3D mesh renderers using PyTorch:
- `mesh_renderer`: A port of Google's [tf_mesh_renderer](https://github.com/google/tf_mesh_renderer) from Tensorflow to PyTorch. Based on the barycentric formulation from [Genova et al. 2018 "Unsupervised training for 3d morphable model regression."](https://openaccess.thecvf.com/content_cvpr_2018/papers/Genova_Unsupervised_Training_for_CVPR_2018_paper.pdf)
- `soft_mesh_renderer`: An alternate implementation of [SoftRas](https://github.com/ShichenLiu/SoftRas) that I built for my own learning. Based on the probabilistic rasterization formulation by [Liu et al. 2019 "Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning"](https://arxiv.org/abs/1904.01786).
# Setup
1. Create a virtual environment with `python3 -m venv env`
2. Activate it with `source env/bin/activate`
3. Install external dependencies with `pip install -r requirements.txt`
Some additional setup is required to use the optimized kernel for the barycentric renderer. See [docs](https://github.com/andrewkchan/pytorch_mesh_renderer/blob/master/src/mesh_renderer/README.md) for more.
# Testing
Tests are included for both renderers.
- mesh_renderer: See [mesh_renderer docs](https://github.com/andrewkchan/pytorch_mesh_renderer/blob/master/src/mesh_renderer/README.md) for how to run these tests.
- soft_mesh_renderer: See [soft_mesh_renderer docs](https://github.com/andrewkchan/pytorch_mesh_renderer/blob/master/src/soft_mesh_renderer/README.md) for how to run these tests.