{"id":16147849,"url":"https://github.com/eigenvivek/pytorchse3","last_synced_at":"2025-05-06T18:46:02.234Z","repository":{"id":210968044,"uuid":"727811050","full_name":"eigenvivek/pytorchse3","owner":"eigenvivek","description":"Numerically stable implementation of batched SE(3) exponential and logarithmic maps","archived":false,"fork":false,"pushed_at":"2024-04-23T12:43:03.000Z","size":385,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T15:49:45.810Z","etag":null,"topics":["se3"],"latest_commit_sha":null,"homepage":"https://vivekg.dev/pytorchse3/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eigenvivek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-05T16:12:15.000Z","updated_at":"2024-04-23T12:42:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0bb6b32-272c-4fa5-8d35-8463d451eab3","html_url":"https://github.com/eigenvivek/pytorchse3","commit_stats":null,"previous_names":["eigenvivek/pytorchse3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eigenvivek%2Fpytorchse3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eigenvivek%2Fpytorchse3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eigenvivek%2Fpytorchse3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eigenvivek%2Fpytorchse3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eigenvivek","download_url":"https://codeload.github.com/eigenvivek/pytorchse3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252748123,"owners_count":21798264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["se3"],"created_at":"2024-10-10T00:27:54.462Z","updated_at":"2025-05-06T18:46:02.216Z","avatar_url":"https://github.com/eigenvivek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytorchse3\n================\n\n**⚠️ PyTorch3D v0.7.6 [improved the numerical stability](https://github.com/facebookresearch/pytorch3d/commit/292acc71a33bf389225ef02af237dd82a8319f59) of their `so3_log_map`/`so3_exp_map`, addressing the main issues fixed by this package. Therefore, you should install PyTorch3D instead for SO(3)/SE(3) transformations.**\n\n## Install\n\n``` sh\npip install pytorchse3\n```\n\n## How to use\n\n``` python\nimport torch\n\nfrom pytorchse3.se3 import se3_exp_map, se3_log_map\n```\n\nHere are two transformation matrices for which `PyTorch3D` recovers the\nwrong log map (see [this\nissue](https://github.com/facebookresearch/pytorch3d/issues/1609?notification_referrer_id=NT_kwDOAcYOvLM3MzY1NTAxMTY0OjI5NzU3MTE2#issuecomment-1839450529)).\n\n``` python\nT = torch.Tensor(\n    [\n        [\n            [-0.7384057045, 0.3333132863, -0.5862244964, 0.0000000000],\n            [0.3520625532, -0.5508944392, -0.7566816807, 0.0000000000],\n            [-0.5751599669, -0.7651259303, 0.2894364297, 0.0000000000],\n            [-0.1840534210, -0.1836946011, 0.9952554703, 1.0000000000],\n        ],\n        [\n            [-0.7400283217, 0.5210028887, -0.4253400862, 0.0000000000],\n            [0.5329059958, 0.0683888718, -0.8434065580, 0.0000000000],\n            [-0.4103286564, -0.8508108258, -0.3282552958, 0.0000000000],\n            [-0.1197679043, 0.1799146235, 0.5538908839, 1.0000000000],\n        ],\n    ],\n).transpose(-1, -2)\n```\n\n`pytorchse3` computes the correct log map.\n\n``` python\nlog_T_vee = se3_log_map(T)\nlog_T_vee\n```\n\n    tensor([[ 1.1319,  1.4831, -2.5131, -0.8503, -0.1170,  0.7346],\n            [ 1.1288,  2.2886, -1.8147, -0.8812,  0.0367, -0.1004]])\n\nExponentiating the log map recovers the original transformation matrix\nwith 1e-4 absolute error.\n\n``` python\neq_T = se3_exp_map(log_T_vee)\nassert torch.allclose(T, eq_T, atol=1e-4)\n```\n\n``` python\nT - eq_T\n```\n\n    tensor([[[-9.2983e-06, -2.3842e-07,  1.1504e-05,  2.9802e-08],\n             [-5.1558e-06,  8.5235e-06, -8.6427e-06, -2.9802e-08],\n             [ 8.6427e-06, -6.4373e-06,  4.4703e-07,  0.0000e+00],\n             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]],\n\n            [[ 8.0466e-06,  1.6212e-05,  6.0201e-06, -3.7253e-08],\n             [ 4.5896e-06,  8.6352e-06,  3.3975e-06,  2.9802e-08],\n             [-8.5831e-06,  1.0610e-05, -1.6809e-05,  0.0000e+00],\n             [ 0.0000e+00,  0.0000e+00,  0.0000e+00,  0.0000e+00]]])\n\n## References\n\n- `pytorchse3` implements log/exp maps defined in Section 2 and 3 of\n  [Ethan Eade’s tutorial](https://ethaneade.com/lie.pdf)\n- Our numerically stable\n  [`so3_log_map`](https://vivekg.dev/pytorchse3/so3.html#so3_log_map) is\n  a PyTorch port of\n  [`pytransform3d`](https://github.com/dfki-ric/pytransform3d/blob/c45e817c4a7960108afe9f5259542c8376c0e89a/pytransform3d/rotations/_conversions.py#L1719-L1787)\n- Taylor expansions for some coefficients in\n  [`se3_log_map`](https://vivekg.dev/pytorchse3/se3.html#se3_log_map)\n  are taken from\n  [`H2-Mapping`](https://github.com/SYSU-STAR/H2-Mapping/blob/11b8ab15f3302ccb2b4b3d2b30f76d86dcfcde2c/mapping/src/se3pose.py#L89-L118)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feigenvivek%2Fpytorchse3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feigenvivek%2Fpytorchse3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feigenvivek%2Fpytorchse3/lists"}