Skip to main content
OrionVis

OrionVis

A PyTorch‑friendly Computer Vision toolkit for unified backbone loading, feature extraction, and registered preprocessing.

Python License Status Issues

Overview

OrionVis streamlines common CV workflows in PyTorch: load backbones with a single call, manage pretrained weights via YAML with lazy indexing, and apply registered transforms for classification inference. It consolidates model, weight, and preprocessing logic while staying lightweight and production‑ready.

Features

  • Unified backbone loader: resnet*, dino*, mobilemamba_*.
  • YAML‑based weights with cached index and lazy loading.
  • Transform registry (e.g., ImageClassification) for ready‑to‑use preprocessing.
  • Feature extraction helpers and utilities.
OrionVis_Banner

Installation

Prerequisites:

  • NVIDIA GPU with CUDA (tested on CUDA 11.8+)
  • PyTorch >= 2.0
  • Microsoft Visual C++ Build Tools (for Windows)

If you do not want to compile from source, you can install the pre-built wheel package directly:

pip install orionvis

For Windows users, we provide a build.bat script that handles environment setup, cleaning, and editable installation:

git clone https://github.com/bluemoon-o2/orionvis
cd orionvis
# install in editable mode
build.bat

CUDA Extensions

OrionVis comes with integrated high-performance CUDA extensions to accelerate specific operations. These extensions are automatically compiled during installation.

1. Selective Scan (Mamba)

Optimized CUDA implementation of the Selective Scan mechanism used in Mamba architectures (mamba_mobile, etc.). It provides significant speedups compared to the pure PyTorch implementation.

  • Backend: orionvis.extentions.selective_scan
  • Usage: Automatically used by mobilemamba backbones when available.

2. InPlace Activated Batch Normalization (InPlace-ABN)

A memory-efficient implementation of Batch Normalization combined with activation functions. It performs the activation in-place, saving GPU memory during training.

  • Backend: orionvis.extentions.inplace_abn
  • Usage:
from orionvis.extentions.inplace_abn import InPlaceABN

# Use just like standard BatchNorm2d but with activation included
layer = InPlaceABN(num_features=64, activation="leaky_relu", activation_param=0.01)

Quickstart

import orionvis

# Load a backbone with pretrained weights
model = orionvis.load("mobilemamba_b1s")

# Retrieve weight metadata and preprocessing transform
weight = orionvis.get_weights("mobilemamba_b1s")
transform = orionvis.get_transform("mobilemamba_b1s")

# Example: preprocess an input PIL image
# img = transform(img)
# logits = model(img.unsqueeze(0))

OrionVis Hub

OrionVis Hub allows you to load models and entrypoints directly from GitHub repositories or local directories.

Load Model

Load a model or entrypoint from a GitHub repository:

import orionvis.hub as hub

# Load from GitHub
model = hub.load("pytorch/vision:v0.10.0", "resnet18")

# Load from a local directory
# model = hub.load("/path/to/local/repo", "custom_model", source="local")

List Entrypoints

List all available entrypoints in a repository:

import orionvis.hub as hub

entrypoints = hub.entrypoints("pytorch/vision:v0.10.0")
print(entrypoints)

View Documentation

View the docstring of a specific entrypoint:

import orionvis.hub as hub

doc = hub.docs("pytorch/vision:v0.10.0", "resnet18")
print(doc)

Load State Dict

Download and load a state dictionary from a URL:

import orionvis.hub as hub

state_dict = hub.load_state_dict_from_url(
    "https://download.pytorch.org/models/resnet18-5c106cde.pth",
    check_hash=True
)

Models

  • Programmatic list: orionvis.list_models()
  • Included backbones: resnext*, wide_resnet*, dinov2_*, dinov3_*, mobilemamba_*.

Weights

  • Config path: orionvis/configs/weights/mobilemamba.yaml (multi‑model YAML; one class per document).
  • Download path cache: ~/.cache/orionvis (configurable via ORIONVIS_CACHE).

License

Apache License 2.0

Citation

@article{mobilemamba,
  title={MobileMamba: Lightweight Multi-Receptive Visual Mamba Network},
  author={Haoyang He and Jiangning Zhang and Yuxuan Cai and Hongxu Chen and Xiaobin Hu and Zhenye Gan and Yabiao Wang and Chengjie Wang and Yunsheng Wu and Lei Xie},
  journal={arXiv preprint arXiv:2411.15941},
  year={2024}
}

References

Metadata

Release files for orionvis 1.1.3

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

Source distribution (sdist)

Source distribution for orionvis 1.1.3
File Size Uploaded
orionvis-1.1.3.tar.gz 13.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for orionvis 1.1.3
File Interpreter ABI Platform
orionvis-1.1.3-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details

Total release size: 22.9 MB

Release files / orionvis-1.1.3.tar.gz

Download URL orionvis-1.1.3.tar.gz
Size 13.2 MB
Tags Source
SHA-256 checksum
How to use checksums
45fa780d71e72f9515976b7ffcd38cf9757fb5e1fba68254352b5c16b2d423a2
BLAKE2b-256 checksum
How to use checksums
771f10d5f090eb540157b3bb1cab8a26b87c6a5eab01fdd9c16a30187e6d0425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / orionvis-1.1.3-cp311-cp311-win_amd64.whl

Download URL orionvis-1.1.3-cp311-cp311-win_amd64.whl
Size 9.8 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f0a64670205a7a2d5e0531fd09b9ca7bc71dcbbd42b646c57d6ca914c97d2362
BLAKE2b-256 checksum
How to use checksums
52cba8a402311176f0c8062ada6b586beccb624519c7fbc1bbe257e5fc78cd14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

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