Views
No views yet
1IMAGE PATH
2image
3 -> frozen LingBot-G
4 -> 1536D patch features
5 -> learned visual projection
6 -> normalized 256D patch vectors
7
8TEXT PATH (precomputed once for the bundled vocabulary)
9tag text
10 -> frozen Qwen3.5-0.8B
11 -> cached 1024D tag vector
12 -> learned text projection
13 -> normalized 256D tag vector
14
15COMPARISON AND POOLING
16patch vectors + tag vector
17 -> cosine similarity x learned scale
18 -> one response per patch/tag pair
19 -> adaptive top-patch pooling at 1%, 3%, and 8% (minimum 2 patches)
20 -> image/tag scoresqrt(negative examples / positive examples), clamped to 1-201pip install -r requirements.txt
2python inference.py assets/example.png --query sword --output sword-map.png--query. If the
query is outside the bundled vocabulary, Qwen3.5-0.8B is loaded to encode it.| Input | sword response |
|---|---|
![]() | ![]() |
snow, fox, weapon, and sword as its top four bundled concepts.1import torch
2
3from adapter import load_adapter, top_queries
4
5device = "cuda"
6
7adapter, query_embeddings, config = load_adapter(".", device=device)
8queries = config["tags"]
9
10# Produce these with LingBot-Vision-Giant.
11# patch_tokens: [batch, patches, 1536]
12# valid_patches: [batch, patches], True for real image patches
13patch_tokens = ...
14valid_patches = ...
15
16with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16):
17 image_logits, patch_logits = adapter(
18 patch_tokens,
19 valid_patches,
20 query_embeddings,
21 )
22
23print(top_queries(image_logits, queries, limit=20)[0])patch_logits keeps the native LingBot patch order and can be reshaped to its spatial
grid. adapter.py also provides encode_queries for giving Qwen arbitrary text queries,
although the bundled config.json contains the concepts that it was trained on.top_queries returns ordinal rank and query text. Spatial behavior varies with the image,
query, and input resolution.model.safetensors: the learned alignment-head weights and 2,048 cached Qwen query vectorsconfig.json: architecture, training configuration, and supported query namesadapter.py: loader, optional Qwen query encoder, and scoring implementationinference.py: end-to-end image ranking and response-map command-line toolassets/: metadata-free example image and its sword response overlay