TGM: PyTorch Geometry
Clone or download
Latest commit b8f3358 Jan 22, 2019

README.rst Documentation Status

The PyTorch Geometry package is a geometric computer vision library for PyTorch.

It consists of a set of routines and differentiable modules to solve generic geometry computer vision problems. At its core, the package uses PyTorch as its main backend both for efficiency and to take advantage of the reverse-mode auto-differentiation to define and compute the gradient of complex functions.


From pip:

pip install torchgeometry

From source:

python install

From source using pip:

pip install git+

Quick Usage

import torch
import torchgeometry as tgm

x_rad = tgm.pi * torch.rand(1, 3, 3)
x_deg = tgm.rad2deg(x_rad)

torch.allclose(x_rad, tgm.deg2rad(x_deg))  # True


Run our Jupyter notebooks examples to learn to use the library.


If you are using torchgeometry in your research-related documents, it is recommended that you cite the poster.

 author    = {E. Riba, M. Fathollahi, W. Chaney, E. Rublee and G. Bradski}
 title     = {torchgeometry: when PyTorch meets geometry},
 booktitle = {PyTorch Developer Conference},
 year      = {2018},
 url       = {}


We appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion. If you plan to contribute new features, utility functions or extensions, please first open an issue and discuss the feature with us. Please, consider to read the CONTRIBUTING notes.