skillfed

geomloss

Geometric loss functions between point clouds, images and volumes.

geomloss v0.3.1 158.2K downloads/30d#10,731 on PyPI
Permissive license MIT Active released

What it is and what it does

Geomloss implements geometric loss functions for comparing structured data like point clouds, images, and volumetric data using optimal transport theory and kernel methods. It wraps PyTorch tensors to compute distances and divergences between distributions, making it useful for tasks that need differentiable, geometrically meaningful loss metrics rather than standard Euclidean or statistical measures.

The package is designed for machine learning and scientific computing workflows where you need to optimize over geometric structures. It depends on numpy, scipy, and torch, so it integrates naturally into PyTorch-based pipelines. The code is marked pre-alpha but actively maintained, indicating it is still evolving but usable for research and production work.

Use it for:

  • Training generative models (GANs, VAEs) with geometric loss instead of pixel-space or feature-space losses.
  • Comparing 3D point clouds in computer vision or robotics applications.
  • Computing optimal transport distances between probability measures in statistical learning.
  • Shape matching and registration tasks in medical imaging or geometry processing.
  • Differentiable metric learning where standard distances are too rigid.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes geometric loss functions for comparing point clouds, images, and volumes using optimal transport and kernel methods, built on PyTorch and NumPy.

Yes, if you are working with PyTorch and need geometric or optimal-transport-based loss functions. The pre-alpha status and recent maintenance suggest active development; the low install friction and permissive license make it a low-risk addition. Install only if you have a specific use case for optimal transport or kernel-based metrics—it is not a general-purpose library.

Install

geomloss on PyPI

pip

pip install geomloss

uv

uv add geomloss

poetry

poetry add geomloss

Installing geomloss

Before you install

Low install friction with a pure-Python wheel. Marked pre-alpha (Development Status 2) but actively maintained with a recent release. Depends on numpy, scipy, and torch, which are standard scientific Python packages.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install geomloss
import geomloss
# Compute loss between two point clouds using torch tensors
loss = geomloss.SamplesLoss("sinkhorn")
result = loss(cloud_a, cloud_b)

Requires PyTorch (torch) to be installed; geomloss itself does not bundle it. Minimum Python 3.8.

Verify before relying

  • Whether the package provides pre-built GPU kernels or relies entirely on PyTorch's backend.
  • Performance characteristics and scalability limits for large point clouds or high-dimensional data.
  • Availability and quality of documentation beyond the project website.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 3 — numpy, scipy, torch
Maintenance actively maintained — 101 days since the last release
First released
Downloads 158,195/month — #10,731 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: geomloss-0.3.1-py3-none-any.whl

Keywords: kernels, optimal transport, measure, loss, geometry

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering

Tags

optimal transport loss functionspoint cloud distance metricsgeometric loss computationWasserstein distancekernel-based loss functionsimage volume comparisonmeasure divergence
optimal-transportgeometric-learningpytorch-integration

More Scientific/Engineering packages

Further reading