--- id: roma version: "1.6" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # roma — A lightweight library to deal with 3D rotations in PyTorch. License: permissive · Maintenance: active · Downloads: 238.1K/mo ## What it is and what it does RoMa is a PyTorch library for working with 3D rotations in machine learning pipelines. It handles conversions between common rotation representations—rotation vectors, unit quaternions, rotation matrices, and Euler angles—while maintaining differentiability throughout for backpropagation. The library also provides rotation-space metrics (geodesic distance, cosine angle), quaternion operations, spherical interpolation, and rigid transformation composition. The package targets researchers and engineers building neural networks or optimization systems that need to reason about 3D rotations. It abstracts away the mathematical complexity of rotation manifolds and provides utilities like Procrustes orthonormalization and Gram-Schmidt orthogonalization for converting arbitrary matrices to valid rotations. Batch operations are supported naturally across arbitrary dimensions. Use it for: - Train neural networks that predict 3D rotations or rotation-parameterized transformations in computer vision or robotics - Implement gradient-based optimization over rotation space for pose estimation or alignment problems - Convert between rotation representations in a differentiable pipeline without breaking the computational graph - Interpolate smoothly between rotations using spherical interpolation for animation or trajectory generation - Compose and invert rigid transformations (rotation + translation) in batch form for 3D geometry operations ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. RoMa provides differentiable conversions between 3D rotation representations (rotation vectors, quaternions, rotation matrices, Euler angles) and utilities for rotation-space operations in PyTorch, designed for machine learning and gradient-based optimization. Yes. RoMa is actively maintained, has no known vulnerabilities, installs with minimal friction (two common dependencies), and fills a specific need for differentiable rotation handling in PyTorch. The permissive BSD-3-Clause license poses no barrier. Install it if your project involves 3D rotations, pose estimation, or rotation-aware neural networks. ## Install pip install roma uv add roma poetry add roma ## Installing roma Before you install: Low friction: pure Python wheel with only torch and numpy as runtime dependencies. Actively maintained with a recent release (3 days old) and steady repository activity. License in practice: BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution and license notice required in distributions. Quickstart: pip install roma import torch import roma rotvec = torch.randn(2, 3, 3) q = roma.rotvec_to_unitquat(rotvec) R = roma.unitquat_to_rotmat(q) Requires PyTorch and NumPy; Python >= 3.8 Verify before relying: - Performance characteristics (speed, memory) relative to alternatives for large-scale rotation operations - Numerical stability guarantees for edge cases (near-singularities, very small rotations) - Completeness of gradient support across all conversion functions ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 238.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags 3d rotation pytorch, rotation representation conversion, differentiable rotation math, quaternion rotation matrix, rotation space optimization, euler angles pytorch, rotation interpolation, rigid transformation pytorch, rotation-geometry, pytorch-math, differentiable-computing [View on SkillFed](https://skillfed.io/packages/roma) · [View on PyPI](https://pypi.org/project/roma/)