Visers Nano

Nano is a compact visual encoder for CPU image retrieval. It maps 128×128 RGB images to L2-normalized embeddings for similarity search. The model uses a MobileNetV4-Conv-Small-0.50 backbone distilled from SigLIP2 Base, with per-channel W8 weights and a Matryoshka projection head.
This upload corresponds to Visers v1.0.0.
Evaluation



The 256D Rust build reaches 0.431 ms P50 and 2,268 images/s on one core of an Intel Core i7-8700K. NanoSpinPool reaches 13,224 images/s across six cores. These measurements include preprocessing from in-memory RGB.
abstract-v2 held-out task | nDCG@10 |
|---|---|
| Art Style | 0.7686 |
| Art Genre | 0.5291 |
| Cross-Genre Style | 0.6776 |
| Photo (COCO) | 0.4126 |
The dataset splits and timing protocol are in the benchmark report and the release assets.
Files
| File | Runtime | Output |
|---|---|---|
nano_v1.bin | Visers Rust runtime, VSN1 W8 weight format | 256D by default, with 128D and 64D build options |
nano-v1-mrl256.onnx | ONNX Runtime CPU, W8 weights stored as FP32 | [1, 256] |
The native Rust build embeds approximately 489 KiB of weights for 256D and selects AVX2/FMA kernels on supported x86-64 CPUs. It also provides a scalar path.
ONNX Runtime
Install huggingface_hub, onnxruntime, numpy, and pillow. The graph input is named input and has shape [1, 3, 128, 128] (NCHW, float32). Scale each RGB channel as (pixel / 255 - 0.5) / 0.5. The output is named output and is already L2-normalized.
import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from PIL import Image
model_path = hf_hub_download(
repo_id="0himera/visers-nano",
filename="nano-v1-mrl256.onnx",
revision="v1.0.0",
)
options = ort.SessionOptions()
options.intra_op_num_threads = 1
options.inter_op_num_threads = 1
session = ort.InferenceSession(
model_path, sess_options=options, providers=["CPUExecutionProvider"]
)
image = Image.open("image.jpg").convert("RGB").resize((128, 128), Image.Resampling.BILINEAR)
pixels = np.asarray(image, dtype=np.float32)
pixels = (pixels / np.float32(255.0) - np.float32(0.5)) / np.float32(0.5)
inputs = np.ascontiguousarray(pixels.transpose(2, 0, 1)[None])
embedding = session.run(["output"], {"input": inputs})[0][0]
The example resizes the input to the model resolution. To compare ONNX and Rust encoder output, use the same RGB pixels in both runtimes.
Rust
The Visers crate includes the Nano weights at build time. Pin the Git dependency to the matching release.
[dependencies]
visers = { package = "visers-nano", git = "https://github.com/0himera/visers", tag = "v1.0.0" }
fn main() -> Result<(), Box<dyn std::error::Error>> {
let rgb = std::fs::read("image_128x128.rgb")?;
let embedding = visers::encode_single_rgb(&rgb)?;
println!("{} dimensions", embedding.len());
Ok(())
}
The file in this example contains 49,152 interleaved RGB bytes. Use NanoEncoder::from_bytes to load the downloaded VSN1 file directly or see the architecture guide for the format and workspace layout.
License
Apache License 2.0. See LICENSE.