### Development Setup and Environment Management Source: https://github.com/haruishi43/equilib/blob/master/CONTRIBUTING.md Installs dependencies and sets up the development environment using uv. Optionally installs pre-commit hooks for automatic linting. ```bash git lfs install # once per machine, before cloning git clone https://github.com/haruishi43/equilib.git cd equilib uv sync --group dev # create the venv and install package + dev tools uv run pre-commit install # optional: run Ruff automatically on each commit ``` -------------------------------- ### Development Install with uv Source: https://github.com/haruishi43/equilib/blob/master/docs/installation.md Clone the repository and use uv to set up the development environment, installing the package and development tools. ```bash git clone https://github.com/haruishi43/equilib.git cd equilib # create the virtual environment and install the package + dev tools uv sync --group dev ``` -------------------------------- ### Install pyequilib from PyPI Source: https://github.com/haruishi43/equilib/blob/master/docs/installation.md Use this command to install the latest stable version of pyequilib from the Python Package Index. ```bash pip install pyequilib ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/haruishi43/equilib/blob/master/README.md Installs development dependencies using uv and runs the project's tests. Ensure you have cloned the repository and navigated into the project directory first. ```bash git clone https://github.com/haruishi43/equilib.git cd equilib uv sync --group dev # create the venv and install package + dev tools uv run pytest tests # run tests ``` -------------------------------- ### Equi2Pers Function API Example Source: https://github.com/haruishi43/equilib/blob/master/docs/usage.md Shows how to use the equi2pers function directly for transforming equirectangular images to perspective views. Requires numpy and PIL. ```python import numpy as np from PIL import Image from equilib import equi2pers # Input equirectangular image equi_img = Image.open("./some_image.jpg") equi_img = np.asarray(equi_img) equi_img = np.transpose(equi_img, (2, 0, 1)) # HWC -> CHW rots = { "roll": 0.0, "pitch": np.pi / 4, # rotate vertical "yaw": np.pi / 4, # rotate horizontal } # Run equi2pers pers_img = equi2pers( equi=equi_img, rots=rots, height=480, width=640, fov_x=90.0, mode="bilinear", ) ``` -------------------------------- ### Equi2Pers Class API Example Source: https://github.com/haruishi43/equilib/blob/master/docs/usage.md Demonstrates initializing and using the Equi2Pers class for transforming equirectangular images to perspective views. Requires numpy and PIL. ```python import numpy as np from PIL import Image from equilib import Equi2Pers # Input equirectangular image equi_img = Image.open("./some_image.jpg") equi_img = np.asarray(equi_img) equi_img = np.transpose(equi_img, (2, 0, 1)) # HWC -> CHW rots = { "roll": 0.0, "pitch": np.pi / 4, # rotate vertical "yaw": np.pi / 4, # rotate horizontal } # Initialize equi2pers equi2pers = Equi2Pers( height=480, width=640, fov_x=90.0, mode="bilinear", ) # obtain perspective image pers_img = equi2pers(equi=equi_img, rots=rots) ``` -------------------------------- ### Previewing Documentation Locally Source: https://github.com/haruishi43/equilib/blob/master/CONTRIBUTING.md Serves the documentation locally using MkDocs Material for previewing changes. ```bash uv run --group docs mkdocs serve ``` -------------------------------- ### Run Development Tasks with uv Source: https://github.com/haruishi43/equilib/blob/master/docs/installation.md Execute common development tasks such as running tests, linting, and formatting using uv. ```bash uv run pytest tests # run the test suite ``` ```bash uv run ruff check . # lint ``` ```bash uv run ruff format . # format ``` -------------------------------- ### Verifying Build and Distribution Locally Source: https://github.com/haruishi43/equilib/blob/master/CONTRIBUTING.md Performs local checks including linting, formatting, tests, building the package, and checking the distribution files with twine. ```bash uv run ruff check . && uv run ruff format --check . uv run pytest tests uv build && uv run --with twine twine check dist/* ``` -------------------------------- ### Running Tests Source: https://github.com/haruishi43/equilib/blob/master/CONTRIBUTING.md Executes the project's test suite using pytest within the uv-managed environment. ```bash uv run pytest tests ``` -------------------------------- ### Linting and Formatting with Ruff Source: https://github.com/haruishi43/equilib/blob/master/CONTRIBUTING.md Checks code for style violations and formats the code according to project standards using Ruff. ```bash uv run ruff check . uv run ruff format . ``` -------------------------------- ### Equirectangular to Perspective Transform (Class API) Source: https://github.com/haruishi43/equilib/blob/master/README.md Use the class API for reusable transform objects. Instantiate Equi2Pers once and call it multiple times with different rotations. Input images are expected in channel-first format (CHW). ```python import numpy as np from PIL import Image from equilib import Equi2Pers # Input equirectangular image (channel-first: HWC -> CHW) equi_img = np.asarray(Image.open("./some_image.jpg")) equi_img = np.transpose(equi_img, (2, 0, 1)) rots = { "roll": 0.0, "pitch": np.pi / 4, # rotate vertical "yaw": np.pi / 4, # rotate horizontal } equi2pers = Equi2Pers(height=480, width=640, fov_x=90.0, mode="bilinear") pers_img = equi2pers(equi=equi_img, rots=rots) ``` -------------------------------- ### Equirectangular to Perspective Transform (Function API) Source: https://github.com/haruishi43/equilib/blob/master/README.md Use the function API for single-use transforms. The configuration is passed on each call. Input images are expected in channel-first format (CHW). ```python import numpy as np from PIL import Image from equilib import equi2pers equi_img = np.asarray(Image.open("./some_image.jpg")) equi_img = np.transpose(equi_img, (2, 0, 1)) rots = {"roll": 0.0, "pitch": np.pi / 4, "yaw": np.pi / 4} pers_img = equi2pers( equi=equi_img, rots=rots, height=480, width=640, fov_x=90.0, mode="bilinear", ) ``` -------------------------------- ### BibTeX Citation for PyEquilib Source: https://github.com/haruishi43/equilib/blob/master/docs/index.md Use this BibTeX entry to cite the PyEquilib repository in academic work. It includes author, title, URL, and publication year. ```bibtex @software{pyequilib2021github, author = {Haruya Ishikawa}, title = {PyEquilib: Processing Equirectangular Images with Python}, url = {https://github.com/haruishi43/equilib}, version = {0.6.0}, year = {2021}, } ``` -------------------------------- ### equi2cube Source: https://github.com/haruishi43/equilib/blob/master/docs/api.md Transforms an equirectangular projection to a cube map projection. Provides both class and function variants. ```APIDOC ## equi2cube ### Description Transforms an equirectangular projection to a cube map projection. ### Method N/A (SDK/Library Function) ### Endpoint N/A (SDK/Library Function) ### Parameters N/A (Specific parameters depend on the class/function variant used) ### Request Example N/A (SDK/Library Function) ### Response N/A (SDK/Library Function) ``` -------------------------------- ### cube2equi Source: https://github.com/haruishi43/equilib/blob/master/docs/api.md Transforms a cube map projection to an equirectangular projection. Provides both class and function variants. ```APIDOC ## cube2equi ### Description Transforms a cube map projection to an equirectangular projection. ### Method N/A (SDK/Library Function) ### Endpoint N/A (SDK/Library Function) ### Parameters N/A (Specific parameters depend on the class/function variant used) ### Request Example N/A (SDK/Library Function) ### Response N/A (SDK/Library Function) ``` -------------------------------- ### equi2pers Source: https://github.com/haruishi43/equilib/blob/master/docs/api.md Transforms an equirectangular projection to a perspective projection. Provides both class and function variants. ```APIDOC ## equi2pers ### Description Transforms an equirectangular projection to a perspective projection. ### Method N/A (SDK/Library Function) ### Endpoint N/A (SDK/Library Function) ### Parameters N/A (Specific parameters depend on the class/function variant used) ### Request Example N/A (SDK/Library Function) ### Response N/A (SDK/Library Function) ``` -------------------------------- ### pers2equi Source: https://github.com/haruishi43/equilib/blob/master/docs/api.md Transforms a perspective projection to an equirectangular projection. Provides both class and function variants. ```APIDOC ## pers2equi ### Description Transforms a perspective projection to an equirectangular projection. ### Method N/A (SDK/Library Function) ### Endpoint N/A (SDK/Library Function) ### Parameters N/A (Specific parameters depend on the class/function variant used) ### Request Example N/A (SDK/Library Function) ### Response N/A (SDK/Library Function) ``` -------------------------------- ### equi2equi Source: https://github.com/haruishi43/equilib/blob/master/docs/api.md Transforms an equirectangular projection to another equirectangular projection. Provides both class and function variants. ```APIDOC ## equi2equi ### Description Transforms an equirectangular projection to another equirectangular projection. ### Method N/A (SDK/Library Function) ### Endpoint N/A (SDK/Library Function) ### Parameters N/A (Specific parameters depend on the class/function variant used) ### Request Example N/A (SDK/Library Function) ### Response N/A (SDK/Library Function) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.