Skip to main content

poselib-gpu

Robust relative pose and absolute pose (PnP) for calibrated cameras, over batches of problems: the five-point solver and P3P inside LO-RANSAC, with non-linear refinement, ported from PoseLib, with hand-written GPU kernels for Metal and CUDA where a GPU is measured faster than the CPU.

Use PoseLib for real work. This project is a test bed for batching and GPU kernels, not a replacement for it. It adds nothing to PoseLib except speed: no new solvers, models or features, and only a subset of what PoseLib offers. The methods, and the credit for them, are PoseLib's (BSD-3-Clause, Copyright (c) 2020 Viktor Larsson; the notice ships in the package).

Install

One of three packages, all providing the module poselib_gpu:

Package Platforms Backends
poselib-gpu Linux x86_64, macOS arm64, Windows x86_64 CPU; Metal on macOS
poselib-gpu-cu12 Linux x86_64, Windows x86_64 CPU and CUDA, built with CUDA 12 (GPUs from Pascal, sm_60)
poselib-gpu-cu13 Linux x86_64, Windows x86_64 CPU and CUDA, built with CUDA 13 (GPUs from Turing, sm_75)
pip install poselib-gpu          # or poselib-gpu-cu12 / poselib-gpu-cu13

The CUDA packages link the CUDA runtime statically: they need only an NVIDIA driver that supports their CUDA version, and no CUDA toolkit. Install one package, not several.

Use

import numpy as np
import poselib_gpu as pg

ctx = pg.Context()                      # "auto": every problem starts on the CPU; those still
                                        # running move to the GPU where that is measured faster
cam = pg.Camera("PINHOLE", [fx, fy, cx, cy])

# Image pairs: one (m, 2) array of matched pixels per pair, in image a and in image b.
r = ctx.relative_pose([xy_a0, xy_a1], [xy_b0, xy_b1], cam, max_error_px=1.0)
r.pose        # (n, 7): qw qx qy qz tx ty tz, camera a to camera b, |t| = 1
r.n_inliers   # (n,)
r.inliers     # one boolean mask per pair
r.median_tri_angle_deg, r.status, r.iterations, r.score

# Images to register: pixels and their world points.
r = ctx.absolute_pose([xy0, xy1], [xyz0, xyz1], cam, max_error_px=4.0, min_inlier_ratio=0.25)
r.pose        # world to camera

Several cameras: pass a list and give each problem its index (camera_a, camera_b for pairs, camera for images). Cameras are COLMAP's models with COLMAP's parameter order: SIMPLE_PINHOLE, PINHOLE, SIMPLE_RADIAL, RADIAL, OPENCV, OPENCV_FISHEYE. A status of 0 (ok) only says a model was found: accept a pair or a registration by your own rule on n_inliers.

pg.Context("cpu"), "metal" or "cuda" picks a backend; pg.compiled_backends() lists the ones the package has, and pg.VARIANT, pg.CUDA_VERSION and pg.__version__ say which build it is. The auto rule was measured on an M5 Pro (Metal) and an RTX 2070 Max-Q (CUDA); on other GPUs it is a reasonable start, not a measurement.

Documentation, the C API and measurements: https://poselib-gpu.pages.dev and https://github.com/manlito/poselib-gpu.

Licence: Apache-2.0. The solvers are ported from PoseLib (BSD-3-Clause, Copyright (c) 2020 Viktor Larsson); its notice is in the package.

Metadata

Release files for poselib-gpu 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poselib-gpu 0.1.0
File Size Uploaded Provenance Actions
poselib_gpu-0.1.0.tar.gz 148.0 kB With provenance Details for poselib_gpu-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for poselib-gpu 0.1.0
File Interpreter ABI Platform Actions
poselib_gpu-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for poselib_gpu-0.1.0-cp312-abi3-win_amd64.whl
poselib_gpu-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for poselib_gpu-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
poselib_gpu-0.1.0-cp312-abi3-macosx_13_0_arm64.whl CPython 3.12 abi3 macOS 13.0+ ARM64 Details for poselib_gpu-0.1.0-cp312-abi3-macosx_13_0_arm64.whl

Total release size: 835.6 kB

Release files / poselib_gpu-0.1.0.tar.gz

Download URL poselib_gpu-0.1.0.tar.gz
Size 148.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c52bf0088736cd37a30df2d50823aabe1b570012c3bda095821e33552ec85b37
BLAKE2b-256 checksum
How to use checksums
35a6ad0b2a51da4f20c6c900ddae84ecc04e41a23e5a3c9dd3a2ae6aaada51dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / poselib_gpu-0.1.0-cp312-abi3-win_amd64.whl

Download URL poselib_gpu-0.1.0-cp312-abi3-win_amd64.whl
Size 356.8 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
def74b395f9fb427f37a367a9f989847b1ce6ccb8edbe01049ad79095cad69ff
BLAKE2b-256 checksum
How to use checksums
9fcd9725143fe2787a552ecc9d37edde9c76f2272e330f8657a8a0784810eead
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / poselib_gpu-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL poselib_gpu-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 177.9 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
f8230d1a7e066af72c80bf9e904b4f5b918d7cb974049e922cf157378ef47197
BLAKE2b-256 checksum
How to use checksums
f92525286df58675044138ace57fc85c1ee16e3b4ef365399bf200a0a935c97c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Release files / poselib_gpu-0.1.0-cp312-abi3-macosx_13_0_arm64.whl

Download URL poselib_gpu-0.1.0-cp312-abi3-macosx_13_0_arm64.whl
Size 152.8 kB
Tags CPython 3.12 abi3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
76c5b673783048ea3a509b7994a5a114a35fc92a45dda7b9f19e4f572f87e5a1
BLAKE2b-256 checksum
How to use checksums
8aa11a73a81fb52309c9e7eb38ea5d5751a10dcabe6195fa97c3cc66b71ec17a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

Security for poselib-gpu 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for poselib_gpu-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

4 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page