CLIP ViT-L/14 image encoder, 4-bit ONNX, for SpotClue
The image encoder of openai/clip-vit-large-patch14 at revision 32bd64288804d66eefd0ccbe215aa642df71cc41, exported to ONNX and quantized to 4 bits (MatMulNBits, blocks of 32, symmetric). Nothing was retrained.
SpotClue's workbench runs it in the browser with Transformers.js 4.3.2 (CLIPVisionModelWithProjection, dtype: 'q4', WebGPU or WASM) and puts its own linear country head on the output to suggest the top 5 countries and the driving side of a street photo. The photo stays on the user's device.
| File | What |
|---|---|
onnx/vision_model_q4.onnx |
199 MB. Input pixel_values (1 × 3 × 224 × 224), output image_embeds (768 numbers) |
config.json |
The base model's config, which Transformers.js reads |
Preprocessing is the base model's: shortest edge resized to 224 px (bicubic), center crop to 224 × 224, scaled to 0–1, normalized with CLIP's mean and standard deviation.
Limits
OpenAI's model card for CLIP puts any deployed use of the model, commercial or not, out of scope. SpotClue uses it only to rank a fixed list of countries, measures it on its own test photos, and never uses it to recognize people.
On SpotClue's G1 set of 1,000 street photos from OpenStreetView-5M's test split, with SpotClue's country head: the first guess is right on 55.5%, the right country is in the top 5 on 79.3%. Photos other than street views were not measured.
License
MIT, as the openai/CLIP repository: see LICENSE. Cite Radford et al., "Learning Transferable Visual Models From Natural Language Supervision", ICML 2021.