Lucas Gelfond • Segment Anything 2, in WebGPU
I was talking with Diego Rodriguez a few weeks ago, who encouraged me to hack together a Segment Anything 2 implementation fulling using WebGPU. That's this! It runs completely client-side, no data is sent to the server! You can read the source code here or try a demo at http://webgpu-sam2.lucasgelfond.online/. I've been curious about some of the lower-level browser APIs (WebAssembly and WebGPU) since I started doing frontend, but haven't gotten much of a chance to play with them! The new model seemed like a great excuse to learn. I started off looking a bit into the model, and trying to find some examples of people who'd gotten things working. Segment Anything 2 only came out a week or so ago, so most of the examples were for SAM-1. In web-sam and SAM-in-Browser others had used a small model called MobileSAM to do inference in the browser; it certianly seemed possible! The common approach to running models in the browser is to use Transformers.js, essentially a JS port of the famous H
I was talking with Diego Rodriguez a few weeks ago, who encouraged me to hack together a Segment Anything 2 implementation fulling using WebGPU. That's this! It runs completely client-side, no data is sent to the server! You can read the source code here or try a demo at http://webgpu-sam2.lucasgelfond.online/. Background I've been curious about some of the lower-level browser APIs (WebAssembly and WebGPU) since I started doing frontend, but haven't gotten much of a chance to play with them! The new model seemed like a great excuse to learn. I started off looking a bit into the model,…
saved by
related reading
- Building a web search engine from scratch in two months with 3 billion neural embeddingsblog.wilsonl.in
- MLC | WebLLM: A High-Performance In-Browser LLM Inference Engineblog.mlc.ai
- in browser favicon diffusion! scratch-dit pt.2notebook.neelr.dev
- segment-geospatialsamgeo.gishub.org
- Fine-tune Segment-Anything model. Tips & caveats | by Rustem Glue | Jun, 2023 | Medium | Mediummedium.com
- rsmsrsms.me
- Wayback Machinecohost.org
- WebLLM | Homemlc.ai
- Point of WebGPU on nativekvark.github.io
- Update: Expanding access to Meta Segment Anything 2.1 on Amazon SageMaker JumpStartai.meta.com
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev
- dawn - Git at Googledawn.googlesource.com