CoolFace
Apppublic

techresearchspace/vision-space

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
App README

Vision Lab

A multimodal computer-vision + language playground that runs entirely in the browser โ€” no backend, no API keys, no server costs, and nothing you upload ever leaves your machine. Built on ๐Ÿค— Transformers.js, which executes real transformer models client-side via WebAssembly, with WebGPU acceleration when the browser supports it.

Capabilities

TabTaskModel
CaptionImage โ†’ natural-language descriptionXenova/vit-gpt2-image-captioning
Detect ObjectsDraws bounding boxes for any labels you define, even ones the model wasn't explicitly trained to detectXenova/owlvit-base-patch32
ClassifyZero-shot classification against any labels you defineXenova/clip-vit-base-patch32
Read TextOCR on printed text in an imageXenova/trocr-small-printed
Semantic SearchRank a gallery of images against a natural-language queryXenova/clip-vit-base-patch32 (shared)

How it works

  • โ€”Lazy loading. Each model downloads and initializes only the first time its tab is used โ€” not all four load up front. Progress is streamed live to the system log at the bottom of the page.
  • โ€”WebGPU / WASM fallback. On load, the app probes for a WebGPU adapter. If present, inference runs hardware-accelerated; otherwise it falls back to WASM (CPU) automatically.
  • โ€”Semantic search without embeddings math. Rather than manually computing and comparing CLIP image/text embeddings, the search tab reuses the zero-shot classification pipeline with a single candidate label (the query) per gallery image โ€” the resulting confidence score is a valid relevance signal for ranking.
  • โ€”Browser caching. Once a model has been downloaded, the browser's own cache keeps it available on repeat visits without re-downloading.

Why this shape

This is deliberately built as a static Hugging Face Space (sdk: static) rather than a Gradio Space, so it can be hosted for free with no compute plan required โ€” all inference happens on the visitor's own device.

Running locally

No build step. Just open index.html in a browser, or serve the folder:

bash
python -m http.server 8000

Extending it

Ideas for going further: add a webcam capture option alongside file upload, swap in a larger captioning model for better quality (trading off download size), or add an "export gallery as JSON" button to persist search results across sessions.

A note on transformers.js task coverage

Not every task in the Python transformers library has a browser equivalent. Visual question answering, for instance, isn't currently a supported transformers.js pipeline โ€” only its listed NLP, vision, audio, and multimodal tasks (embeddings, zero-shot classification/detection) run client-side. Object detection was used here instead of VQA for exactly that reason: it's a confirmed, supported multimodal task that still combines free-form text labels with an image.

techresearchspace/vision-space ยท CoolFace