{"id":13411772,"url":"https://github.com/haruishi43/equilib","last_synced_at":"2026-01-16T10:28:55.416Z","repository":{"id":42376768,"uuid":"179031755","full_name":"haruishi43/equilib","owner":"haruishi43","description":"🌎→🗾Equirectangular (360/panoramic) image processing library for Python with minimal dependencies only using Numpy and PyTorch","archived":false,"fork":false,"pushed_at":"2025-07-29T08:30:43.000Z","size":20880,"stargazers_count":199,"open_issues_count":8,"forks_count":25,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T16:53:16.707Z","etag":null,"topics":["360-degree","camera","cubemap-to-equirectangular","equirectangular-images","equirectangular-panorama","equirectangular-projection","numpy","panorama","perspective-projection","python","pytorch","vr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haruishi43.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2019-04-02T08:21:32.000Z","updated_at":"2025-09-30T14:27:15.000Z","dependencies_parsed_at":"2022-07-07T16:53:28.850Z","dependency_job_id":"0b4f040a-6291-4c02-830c-5b7744ab1fe6","html_url":"https://github.com/haruishi43/equilib","commit_stats":{"total_commits":248,"total_committers":4,"mean_commits":62.0,"dds":"0.13709677419354838","last_synced_commit":"71a88af6545fa5fbb0d2adc030f726de0243205a"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/haruishi43/equilib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haruishi43%2Fequilib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haruishi43%2Fequilib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haruishi43%2Fequilib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haruishi43%2Fequilib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haruishi43","download_url":"https://codeload.github.com/haruishi43/equilib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haruishi43%2Fequilib/sbom","scorecard":{"id":456539,"data":{"date":"2025-08-11","repo":{"name":"github.com/haruishi43/equilib","commit":"ff7268034068321776b85f419738ac47b5724e96"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/23 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":5,"reason":"3 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/haruishi43/equilib/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/haruishi43/equilib/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/haruishi43/equilib/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/haruishi43/equilib/python-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/haruishi43/equilib/python-publish.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"96 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: GHSA-267x-w5hx-8hjr","Warn: Project is vulnerable to: GHSA-33h2-69j3-r336","Warn: Project is vulnerable to: GHSA-3448-vrgh-85xr","Warn: Project is vulnerable to: GHSA-5rpc-gwh9-q9fg","Warn: Project is vulnerable to: GHSA-634c-v2xv-ffpg","Warn: Project is vulnerable to: GHSA-6v6p-p97v-g2p7","Warn: Project is vulnerable to: GHSA-83rh-hx5x-q9p5","Warn: Project is vulnerable to: GHSA-8849-5h85-98qw","Warn: Project is vulnerable to: GHSA-89rj-5ggj-3p9p","Warn: Project is vulnerable to: GHSA-8w3x-457r-wg53","Warn: Project is vulnerable to: GHSA-9g8h-pjm4-q92p","Warn: Project is vulnerable to: GHSA-c7gp-2pch-qh2v","Warn: Project is vulnerable to: GHSA-cvhw-2593-5j2q","Warn: Project is vulnerable to: GHSA-fffj-9qwg-qmh5","Warn: Project is vulnerable to: GHSA-fm39-cw8h-3p63","Warn: Project is vulnerable to: GHSA-fr58-2xhv-qp3w","Warn: Project is vulnerable to: GHSA-fvq6-392h-6mjj","Warn: Project is vulnerable to: GHSA-fw99-f933-rgh8","Warn: Project is vulnerable to: GHSA-hxfw-jm98-v4mq","Warn: Project is vulnerable to: GHSA-jcxv-2j3h-mg59","Warn: Project is vulnerable to: GHSA-jggw-2q6g-c3m6","Warn: Project is vulnerable to: GHSA-m43c-649m-pm48","Warn: Project is vulnerable to: GHSA-m6vm-8g8v-xfjh","Warn: Project is vulnerable to: GHSA-pqjj-6f5q-gqph","Warn: Project is vulnerable to: GHSA-q799-q27x-vp7w","Warn: Project is vulnerable to: GHSA-qr4w-53vh-m672","Warn: Project is vulnerable to: GHSA-rqxg-xvcq-3v2f","Warn: Project is vulnerable to: GHSA-vc29-rj92-gc7j","Warn: Project is vulnerable to: GHSA-w96g-3p64-63wr","Warn: Project is vulnerable to: GHSA-wq8f-wvqp-xvvm","Warn: Project is vulnerable to: GHSA-x3rm-644h-67m8","Warn: Project is vulnerable to: PYSEC-2023-183","Warn: Project is vulnerable to: GHSA-3c5c-7235-994j","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: PYSEC-2021-41 / GHSA-3wvg-mj6g-m9cv","Warn: Project is vulnerable to: PYSEC-2020-77 / GHSA-3xv8-3j54-hgrp","Warn: Project is vulnerable to: PYSEC-2020-80 / GHSA-43fq-w8qq-v88h","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: GHSA-4fx9-vc88-q2xc","Warn: Project is vulnerable to: PYSEC-2021-35 / GHSA-57h3-9rgr-c24m","Warn: Project is vulnerable to: PYSEC-2020-172 / GHSA-5gm3-px64-rw72","Warn: Project is vulnerable to: PYSEC-2021-331 / GHSA-7534-mm45-c74v","Warn: Project is vulnerable to: PYSEC-2021-92 / GHSA-7r7m-5h27-29hp","Warn: Project is vulnerable to: PYSEC-2020-78 / GHSA-8843-m7mw-mxqm","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: PYSEC-2014-87 / GHSA-8m9x-pxwq-j236","Warn: Project is vulnerable to: PYSEC-2022-10 / GHSA-8vj2-vxx3-667w","Warn: Project is vulnerable to: PYSEC-2021-36 / GHSA-8xjq-8fcg-g5hw","Warn: Project is vulnerable to: PYSEC-2016-6 / GHSA-8xjv-v9xq-m5h9","Warn: Project is vulnerable to: PYSEC-2021-42 / GHSA-95q3-8gr9-gm8w","Warn: Project is vulnerable to: PYSEC-2022-168 / GHSA-9j59-75qj-795w","Warn: Project is vulnerable to: PYSEC-2014-10 / GHSA-cfmr-38g9-f2h7","Warn: Project is vulnerable to: PYSEC-2020-76 / GHSA-cqhg-xjhh-p8hf","Warn: Project is vulnerable to: PYSEC-2021-40 / GHSA-f4w8-cv6p-x6r5","Warn: Project is vulnerable to: PYSEC-2021-69 / GHSA-f5g8-5qq7-938w","Warn: Project is vulnerable to: PYSEC-2021-139 / GHSA-g6rj-rv7j-xwp4","Warn: Project is vulnerable to: PYSEC-2015-16 / GHSA-h5rf-vgqx-wjv2","Warn: Project is vulnerable to: PYSEC-2016-5 / GHSA-hggx-3h72-49ww","Warn: Project is vulnerable to: PYSEC-2020-84 / GHSA-hj69-c76v-86wr","Warn: Project is vulnerable to: PYSEC-2016-7 / GHSA-hvr8-466p-75rh","Warn: Project is vulnerable to: PYSEC-2015-15 / GHSA-j6f7-g425-4gmx","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: PYSEC-2019-110 / GHSA-j7mj-748x-7p78","Warn: Project is vulnerable to: GHSA-jgpv-4h4c-xhw3","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2021-37 / GHSA-mvg9-xffr-p774","Warn: Project is vulnerable to: PYSEC-2020-83 / GHSA-p49h-hjvm-jg3h","Warn: Project is vulnerable to: PYSEC-2022-8 / GHSA-pw3c-h7wp-cvhx","Warn: Project is vulnerable to: PYSEC-2021-93 / GHSA-q5hq-fp76-qmrc","Warn: Project is vulnerable to: PYSEC-2020-82 / GHSA-r7rm-8j6h-r933","Warn: Project is vulnerable to: PYSEC-2014-23 / GHSA-r854-96gq-rfg3","Warn: Project is vulnerable to: PYSEC-2016-8 / GHSA-rwr3-c2q8-gm56","Warn: Project is vulnerable to: PYSEC-2020-81 / GHSA-vcqg-3p29-xw73","Warn: Project is vulnerable to: PYSEC-2020-79 / GHSA-vj42-xq3r-hr3r","Warn: Project is vulnerable to: PYSEC-2021-70 / GHSA-vqcj-wrf2-7v73","Warn: Project is vulnerable to: PYSEC-2016-9 / GHSA-w4vg-rf63-f3j3","Warn: Project is vulnerable to: PYSEC-2014-22 / GHSA-x895-2wrm-hvp7","Warn: Project is vulnerable to: PYSEC-2022-9 / GHSA-xrcv-f9gm-v42c","Warn: Project is vulnerable to: PYSEC-2021-137","Warn: Project is vulnerable to: PYSEC-2021-138","Warn: Project is vulnerable to: PYSEC-2021-317","Warn: Project is vulnerable to: PYSEC-2021-38","Warn: Project is vulnerable to: PYSEC-2021-39","Warn: Project is vulnerable to: PYSEC-2021-94","Warn: Project is vulnerable to: PYSEC-2023-175","Warn: Project is vulnerable to: PYSEC-2019-156 / GHSA-xp76-357g-9wqq","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114","Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T09:50:40.150Z","repository_id":42376768,"created_at":"2025-08-19T09:50:40.150Z","updated_at":"2025-08-19T09:50:40.150Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["360-degree","camera","cubemap-to-equirectangular","equirectangular-images","equirectangular-panorama","equirectangular-projection","numpy","panorama","perspective-projection","python","pytorch","vr"],"created_at":"2024-07-30T20:01:16.761Z","updated_at":"2026-01-16T10:28:55.406Z","avatar_url":"https://github.com/haruishi43.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  equilib\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  Processing Equirectangular Images with Python\n\u003c/h4\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://badge.fury.io/py/pyequilib\"\u003e\u003cimg src=\"https://badge.fury.io/py/pyequilib.svg\" alt=\"PyPI version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pyequilib\"\u003e\u003cimg src=\"https://img.shields.io/pypi/pyversions/pyequilib\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/haruishi43/equilib/actions\"\u003e\u003cimg src=\"https://github.com/haruishi43/equilib/workflows/ci/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/haruishi43/equilib/blob/master/LICENSE\"\u003e\u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/haruishi43/equilib\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003cimg src=\".img/equilib.png\" alt=\"equilib\" width=\"720\"/\u003e\n\n- A library for processing equirectangular image that runs on Python.\n- Developed using Python\u003e=3.6 (`c++` is WIP).\n- Compatible with `cuda` tensors for faster processing.\n- No need for other dependencies except for `numpy` and `torch`.\n- Added functionality like creating rotation matrices, batched processing, and automatic type detection.\n- Works with various input modals\n- Highly modular\n\nIf you found this module helpful to your project, please site this repository:\n```\n@software{pyequilib2021github,\n  author = {Haruya Ishikawa},\n  title = {PyEquilib: Processing Equirectangular Images with Python},\n  url = {http://github.com/haruishi43/equilib},\n  version = {0.5.0},\n  year = {2021},\n}\n```\n\n## Installation:\n\nPrerequisites:\n- Python (\u003e=3.6)\n- Pytorch (tested on 1.12)\n\n```Bash\npip install pyequilib\n```\n\nFor developing, use:\n\n```Bash\ngit clone --recursive https://github.com/haruishi43/equilib.git\ncd equilib\n\npip install -r requirements.txt\n\npip install -e .\n# or\npython setup.py develop\n```\n\n__NOTE__: might not work for PyTorch\u003e=2.0. If you have any issues, please open an issue.\n\n## Basic Usage:\n\n`equilib` has different transforms of equirectangular (or cubemap) images (note each transform has `class` and `func` APIs):\n- `Cube2Equi`/`cube2equi`: cubemap to equirectangular transform\n- `Equi2Cube`/`equi2cube`: equirectangular to cubemap transform\n- `Equi2Equi`/`equi2equi`: equirectangular transform\n- `Equi2Pers`/`equi2pers`: equirectangular to perspective transform\n- `Pers2Equi`/`pers2equi`: perspective to equirectangular transform\n\nThere are no _real_ differences in `class` or `func` APIs:\n- `class` APIs will allow instantiating a class which you can call many times without having to specify configurations (`class` APIs call the `func` API)\n- `func` APIs are useful when there are no repetitive calls\n- both `class` and `func` APIs are extensible, so you can extend them to your use-cases or create a method that's more optimized (pull requests are welcome btw)\n\nEach API automatically detects the input data type (`numpy.ndarray` or `torch.Tensor`), and outputs are the same type. The data layout for input images should be channel-first with dimensions either `BxCxHxW` or `CxHxW`.\n\nThe arguments for each `class` or `func` depends on the transform, but here are the common arguments:\n- `rots`: used to specify the rotation using three angles [pitch, yaw, roll](https://simple.wikipedia.org/wiki/Pitch,_yaw,_and_roll) in radians.\n- `z_down (bool)`: whether to use a coordinate system with z-axis pointing down, defaults to `False`\n- `mode (str)`: interpolation mode, defaults to `bilinear`\n- `clip_output (bool)`: whether to clip values based on the range of the input values, default to `True`\n\nAn example for `Equi2Pers`/`equi2pers`:\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cpre\u003eEqui2Pers\u003c/pre\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cpre\u003eequi2pers\u003c/pre\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\n\u003cpre\u003e\n\n```Python\nimport numpy as np\nfrom PIL import Image\nfrom equilib import Equi2Pers\n\n# Input equirectangular image\nequi_img = Image.open(\"./some_image.jpg\")\nequi_img = np.asarray(equi_img)\nequi_img = np.transpose(equi_img, (2, 0, 1))\n\n# rotations\nrots = {\n    'roll': 0.,\n    'pitch': np.pi/4,  # rotate vertical\n    'yaw': np.pi/4,  # rotate horizontal\n}\n\n# Intialize equi2pers\nequi2pers = Equi2Pers(\n    height=480,\n    width=640,\n    fov_x=90.0,\n    mode=\"bilinear\",\n)\n\n# obtain perspective image\npers_img = equi2pers(\n    equi=equi_img,\n    rots=rots,\n)\n```\n\n\u003c/pre\u003e\n\u003c/td\u003e\n\n\u003ctd\u003e\n\u003cpre\u003e\n\n```Python\nimport numpy as np\nfrom PIL import Image\nfrom equilib import equi2pers\n\n# Input equirectangular image\nequi_img = Image.open(\"./some_image.jpg\")\nequi_img = np.asarray(equi_img)\nequi_img = np.transpose(equi_img, (2, 0, 1))\n\n# rotations\nrots = {\n    'roll': 0.,\n    'pitch': np.pi/4,  # rotate vertical\n    'yaw': np.pi/4,  # rotate horizontal\n}\n\n# Run equi2pers\npers_img = equi2pers(\n    equi=equi_img,\n    rots=rots,\n    height=480,\n    width=640,\n    fov_x=90.0,\n    mode=\"bilinear\",\n)\n```\n\n\u003c/pre\u003e\n\u003c/td\u003e\n\u003c/table\u003e\n\nFor more information about how each APIs work, take a look in [.readme](.readme/) or go through example codes in the `tests` or `scripts`.\n\n\n### Coordinate System:\n\n__Right-handed rule XYZ global coordinate system__. `x-axis` faces forward and `z-axis` faces up.\n- `roll`: counter-clockwise rotation about the `x-axis`\n- `pitch`: counter-clockwise rotation about the `y-axis`\n- `yaw`: counter-clockwise rotation about the `z-axis`\n\nYou can chnage the right-handed coordinate system so that the `z-axis` faces down by adding `z_down=True` as a parameter.\n\nSee demo scripts under `scripts`.\n\n\n## Grid Sampling\n\nTo process equirectangular images fast, whether to crop perspective images from the equirectangular image, the library takes advantage of grid sampling techniques.\nSome sampling techniques are already implemented, such as `scipy.ndimage.map_coordiantes` and `cv2.remap`.\nThis project's goal was to reduce these dependencies and use `cuda` and batch processing with `torch` and `c++` for a faster processing of equirectangular images.\nThere were not many projects online for these purposes.\nIn this library, we implement varieties of methods using `c++`, `numpy`, and `torch`.\nThis part of the code needs `cuda` acceleration because grid sampling is parallelizable.\nFor `torch`, the built-in `torch.nn.functional.grid_sample` function is very fast and reliable.\nI have implemented a _pure_ `torch` implementation of `grid_sample` which is very customizable (might not be fast as the native function).\nFor `numpy`, I have implemented grid sampling methods that are faster than `scipy` and more robust than `cv2.remap`.\nJust like with this implementation of `torch`, `numpy` implementation is just as customizable.\nIt is also possible to pass the `scipy` and `cv2`'s grid sampling function through the use of `override_func` argument in `grid_sample`.\nDeveloping _faster_ approaches and `c++` methods are __WIP__.\nSee [here](equilib/grid_sample/README.md) for more info on implementations.\n\nSome notes:\n\n- By default, `numpy`'s [`grid_sample`](equilib/grid_sample/numpy/) will use pure `numpy` implementation. It is possible to override this implementation with `scipy` and `cv2`'s implementation using [`override_func`](tests/equi2pers/numpy_run_baselines.py).\n- By default, `torch`'s [`grid_sample`](equilib/grid_sample/torch/) will use the official implementation.\n- Benchmarking codes are stored in `tests/`. For example, benchmarking codes for `numpy`'s `equi2pers` is located in [`tests/equi2pers/numpy_run_baselines.py`](tests/equi2pers/numpy_run_baselines.py) and you can benchmark the runtime performance using different parameters against `scipy` and `cv2`.\n\n## Develop:\n\nTest files for `equilib` are included under `tests`.\n\nRunning tests:\n```Bash\npytest tests\n```\n\nNote that I have added codes to benchmark every step of the process so that it is possible to optimize the code.\nIf you find there are optimal ways of the implementation or bugs, all pull requests and issues are welcome.\n\nCheck [CONTRIBUTING.md](./CONTRIBUTING.md) for more information\n\n### TODO:\n\n- [ ] Documentations for each transform\n- [x] Add table and statistics for speed improvements\n- [x] Batch processing for `numpy`\n- [x] Mixed precision for `torch`\n- [ ] `c++` version of grid sampling\n- [ ] More accurate intrinsic matrix formulation using vertial FOV for `equi2pers`\n- [ ] Multiprocessing support (slow when running on `torch.distributed`)\n\n## Acknowledgements:\n\n- [py360convert](https://github.com/sunset1995/py360convert)\n- [Perspective-and-Equirectangular](https://github.com/timy90022/Perspective-and-Equirectangular)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharuishi43%2Fequilib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharuishi43%2Fequilib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharuishi43%2Fequilib/lists"}