--- id: geomloss version: "0.3.1" license: MIT license_treatment: permissive maintenance: active --- # geomloss — Geometric loss functions between point clouds, images and volumes. License: permissive · Maintenance: active · Downloads: 158.2K/mo ## 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 above — 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 pip install geomloss uv add geomloss 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_current - Install friction: low - Maintenance: active - Downloads: 158.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags optimal transport loss functions, point cloud distance metrics, geometric loss computation, Wasserstein distance, kernel-based loss functions, image volume comparison, measure divergence, optimal-transport, geometric-learning, pytorch-integration [View on SkillFed](https://skillfed.io/packages/geomloss) · [View on PyPI](https://pypi.org/project/geomloss/)