Views
No views yet
| Model | Architecture | Embedding Dim | Size | Path |
|---|---|---|---|---|
| hycoclip-vit-b | ViT-B/16 | 513 | ~350 MB | hycoclip-vit-b/model.onnx |
| hycoclip-vit-s | ViT-S/16 | 513 | ~84 MB | hycoclip-vit-s/model.onnx |
| meru-vit-b | ViT-B/16 | 513 | ~350 MB | meru-vit-b/model.onnx |
| meru-vit-s | ViT-S/16 | 513 | ~84 MB | meru-vit-s/model.onnx |
1import onnxruntime as ort
2import numpy as np
3from huggingface_hub import hf_hub_download
4
5# Download a model
6onnx_path = hf_hub_download(
7 repo_id="mnm-matin/hyperbolic-clip",
8 filename="hycoclip-vit-s/model.onnx" # or other model path
9)
10
11# Load and run
12session = ort.InferenceSession(onnx_path)
13image = np.random.rand(1, 3, 224, 224).astype(np.float32) # Your preprocessed image
14embedding, curvature = session.run(None, {"image": image})
15
16print(f"Embedding shape: {embedding.shape}") # (1, 513) - hyperboloid format(t, x₁...xₙ) where t = √(1/c + ‖x‖²)c is learned and exported as secondary output1t = embedding[:, 0:1] # time component
2x = embedding[:, 1:] # spatial components
3poincare = x / (t + 1) # stereographic projection1import hyperview as hv
2from huggingface_hub import hf_hub_download
3
4# Download model
5model_path = hf_hub_download("mnm-matin/hyperbolic-clip", "hycoclip-vit-s/model.onnx")
6
7# Use with HyperView
8ds = hv.Dataset("my_images")
9ds.add_images_dir("/path/to/images")
10ds.compute_embeddings(onnx_path=model_path)
11hv.show(ds)1@inproceedings{desai2023hyperbolic,
2 title={Hyperbolic Image-Text Representations},
3 author={Desai, Karan and Nickel, Maximilian and Rajpurohit, Tanmay and Johnson, Justin and Vedantam, Ramakrishna},
4 booktitle={ICML},
5 year={2023}
6}