DEV Community

OPTTOYSCHINA
OPTTOYSCHINA

Posted on

Camera product search on the mobile web — the feature Alibaba and Amazon keep locked in their apps

Camera-based product search has always been a flex reserved for the giants' native apps: Alibaba has it in the app, Amazon has it in the app. On the mobile web, among B2B marketplaces, we couldn't find it at anyone. So we shipped it on the website itself — and it costs our LCP exactly nothing.

Context: B2B toy marketplace, 389,000 products from 5,233 factories. The full performance story with PageSpeed receipts is here.

The use case that sold us

A wholesale buyer stands at a trade fair in Guangzhou — or in a competitor's shop — points a phone at a toy, and gets the product plus its analogs from our catalog: carton price, MOQ, freight to their hub. No app install, no account wall. One tap from the browser toolbar.

The pipeline

  1. Client: a deferred 50 KB camera modal (more on that below). Photo gets downscaled client-side before upload — nobody ships 12 MP over trade-fair Wi-Fi.
  2. Encoder: SigLIP with a LoRA we fine-tuned on toy imagery, running on a rented RTX A4000 (~$0.085/hr). Encode: ~38 ms.
  3. Retrieval: kNN over 886,219 image embeddings — ~190 ms.
  4. End-to-end, camera click → results: ~0.5 s.

Why a LoRA? Generic CLIP-family models are decent at "a plush toy". Wholesale buyers need "THIS plush hippo, and the three factories making lookalikes". Fine-tuning on toy imagery moved retrieval from cute demo to daily tool.

The performance trick: the feature that isn't there

The camera modal weighs 50 KB — and it is not in the critical path at all. It loads as a deferred chunk after the first screen is painted. Lighthouse literally cannot see it. Our mobile PageSpeed stays 93 on the full 389k-product site, camera search included.

That's the thesis we keep hammering: everything "only a native app can do" — done on the open web, indexed by Google, one link away.

Verify, don't trust

Every text-search request on the site returns an open Server-Timing header — open DevTools on opttoyschina.com and watch the stages. Try the camera button from a phone. Questions about the LoRA training set, the embedding pipeline, or why we didn't use an off-the-shelf visual search API — comments are open.

Top comments (0)