Skip to main content

A lightweight, PyTorch-free spatial computing and feature matching library.

Project description

spatialhub

PyPI version Python 3.12+ License GitHub Repo stars

A lightweight, PyTorch-free computer vision hub for Python.

spatialhub is built for production and fast execution. By removing heavy PyTorch code and using ONNX Runtime, it gives you reliable, server-safe AI models with automatic downloads and zero memory leaks.

Why We Built This

Modern AI research is amazing, but running it in production can be hard due to heavy setups, GPU issues, and high memory usage. spatialhub fixes this by offering:

  • No PyTorch Needed: Models are converted to ONNX so they run much faster and are easier to install.
  • Auto-Downloading: It automatically downloads model files from Hugging Face so your project folder stays clean.
  • Server-Safe: Built with opencv-python-headless so drawing images will never crash your servers or Docker containers.
  • Low Memory: It only loads images into memory when you actually ask to draw and save them.

Available Models

Check the specific guides for our current models:

Roadmap: What's Next

In the future, spatialhub will expand to include more computer vision tools built for real-world use:

  • [Planned] Depth Estimation (e.g., DepthAnything v2)
  • [Planned] Pose Estimation & Object Tracking
  • [Planned] Point Cloud Tools

Installation

Install via pip (requires Python 3.12+):

pip install spatialhub

To enable GPU acceleration, install the optional GPU dependencies:
```bash
pip install "spatialhub[gpu]"

Universal Quickstart

All models in spatialhub share a unified, predictable API structure.

from spatialhub import EfficientLoFTR # Or any future model

def main():
    # Initialize the adapter (weights auto-download on first run)
    model = EfficientLoFTR()
    
    # Run inference on raw paths or numpy arrays
    result = model.match("image1.jpg", "image2.jpg", max_dim=1024)

    # Utilize lazy visualization (safely loads and renders without memory bloat)
    result.visualize(top_k=50, save_path="output.png")

if __name__ == "__main__":
    main()

License

The core spatialhub library is licensed under the Apache 2.0 License.

Note: Individual model architectures and weights downloaded via the library inherit the licenses of their original authors. Please check the specific model documentation directories for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spatialhub-0.1.1.tar.gz (253.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spatialhub-0.1.1-py3-none-any.whl (237.5 kB view details)

Uploaded Python 3

File details

Details for the file spatialhub-0.1.1.tar.gz.

File metadata

  • Download URL: spatialhub-0.1.1.tar.gz
  • Upload date:
  • Size: 253.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for spatialhub-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc149a1240d06d369afce7fbf5b606edd3a693dde2124287010307def0177981
MD5 98084772bd297b6bcdbc92f782060ac6
BLAKE2b-256 973baafacfd4d1734d5cb743f01d93e4acc91a39270d7b70125d99af05e4ee89

See more details on using hashes here.

File details

Details for the file spatialhub-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: spatialhub-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 237.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for spatialhub-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de3c2956db2f0acd3a8f4b850630e0128f992d783038d11edf2bce25f4d3c573
MD5 4197bc91f285beb3c3579d66605233c6
BLAKE2b-256 bd61e86c1823ef32f77d67cec49cf60b47f31d60beecf3047be03835bdb6272d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page