{"library":"roma","title":"RoMa: 3D Rotations in PyTorch","description":"RoMa (Rotation Manipulation) is a lightweight Python library designed to simplify the handling of 3D rotations within PyTorch. It provides differentiable mappings between various 3D rotation representations (e.g., rotation vectors, quaternions, rotation matrices, Euler angles), mappings from Euclidean to rotation space, and a suite of utilities for rotation-related operations. It aims to be an easy-to-use and efficient toolbox for machine learning and gradient-based optimization applications. The current version is 1.5.6, with development actively maintained by NAVER Corp..","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install roma"],"cli":null},"imports":["import roma","import roma.utils"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import torch\nimport roma\n\n# Example: Convert a batch of rotation vectors to unit quaternions and then to rotation matrices\nbatch_shape = (2, 3) # Example: 2 batches of 3 rotations each\n\n# Generate random rotation vectors (3D tensor)\nrotvec = torch.randn(batch_shape + (3,))\nprint(f\"Rotation vector shape: {rotvec.shape}\")\n\n# Convert rotation vectors to unit quaternions (XYZW convention)\nq = roma.rotvec_to_unitquat(rotvec)\nprint(f\"Unit quaternion shape: {q.shape}\")\n\n# Convert unit quaternions to rotation matrices (3x3 tensor)\nR = roma.unitquat_to_rotmat(q)\nprint(f\"Rotation matrix shape: {R.shape}\")\n\n# Direct conversion from rotation vector to rotation matrix\nR_direct = roma.rotvec_to_rotmat(rotvec)\nprint(f\"Direct Rotation matrix shape: {R_direct.shape}\")\nassert torch.allclose(R, R_direct, atol=1e-6)\n\n# Example: Special Procrustes orthonormalization\n# Projects an arbitrary 3x3 matrix onto the closest rotation matrix\nrandom_matrix = torch.randn(batch_shape + (3, 3))\nR_procrustes = roma.special_procrustes(random_matrix)\nprint(f\"Procrustes orthonormalized matrix shape: {R_procrustes.shape}\")","lang":"python","description":"This quickstart demonstrates how to initialize `roma` and perform fundamental conversions between different 3D rotation representations: rotation vectors, unit quaternions, and rotation matrices. It also shows the use of `special_procrustes` to orthonormalize an arbitrary matrix into a valid rotation matrix.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"1.5.6","pypi_latest":"1.5.6","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.5,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"18.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"19.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.5,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"11.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.4,"import_time_s":null,"mem_mb":null,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.5M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"roma","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":1.7,"import_time_s":null,"mem_mb":null,"disk_size":"18M"}]}}