KO
|
EN
gitlite — search
Search
#typescript
#ai-agents
#ai
#dsh-plugin
#deepseek-harness
#open-source
#claude-code
#codex
#cli
#developer-tools
#react
#windows
next-sam
★ 86
Open GitHub ↗
No description available.
Download README (.md)
Explore Similar Repositories
millrace
:
Turns repeatable, domain-agnostic workflows into graph-driven loops.
Coffy
:
Open source lightweight embedded database engine for Python that supports NoSQL, SQL, and Graph data models.
zerobus-sdk
:
Databricks's Zerobus Ingest SDKs
tw-fade
:
Elegant, CSS-driven scroll-edge fade masking for Tailwind CSS v4. Zero JavaScript.
Taix
:
基于Avalonia与Rust构建的跨平台(Windows/macOS)软件与网站使用时长统计工具
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
next-sam
?
Download (.md)
# Client-side image segmentation with SAM2 This is a Next.js application that performs image segmentation using Meta's Segment Anything Model V2 (SAM2) and onnxruntime-web. All the processing is done on the client side. Demo at [sam2-seven.vercel.app](https://sam2-seven.vercel.app/) https://github.com/user-attachments/assets/0d3b9f3b-2ab1-4627-9662-fca1a7cc2289 # Features * Utilizes [Meta's SAM2 model](https://ai.meta.com/blog/segment-anything-2/) for segmentation * [onnxruntime-web](https://github.com/microsoft/onnxruntime) for model inference * webgpu-accelerated if GPU available and supported by browser, cpu if not * Model storage using [OPFS](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system) ([not working](https://bugs.webkit.org/show_bug.cgi?id=231706) in Safari) * Image upload or load from URL * Mask decoding based on point prompt (positive and negative points) * Cropping * Tested on macOS with Edge (webgpu, cpu), Chrome (webgpu, cpu), Firefox (cpu only), Safari (cpu only) * Fails on iOS (17, iPhone SE), not sure why # Installation Clone the repository: ``` git clone https://github.com/geronimi73/next-sam cd next-sam npm install npm run dev ``` Open your browser and visit http://localhost:3000 # Usage 1. Upload an image or load from URL. 2. Click the "Encode image" button to start encoding the image. 3. Once the encoding is complete, click on the image to decode masks. 4. Left click to include area ("positive click"), right click to exclude area ("negative click"). 5. Click the "Crop" button to crop the image using the decoded mask. # Acknowledgements * [Meta's Segment Anything Model 2](https://ai.meta.com/blog/segment-anything-2/) * [@raedle](https://github.com/raedle) for adding [positive/negative clicks](https://github.com/geronimi73/next-sam/pull/1) * [onnxruntime](https://github.com/microsoft/onnxruntime) * [Shadcn/ui components](https://ui.shadcn.com/) * [transformer.js](https://github.com/huggingface/transformers.js) * https://github.com/ibaiGorordo/ONNX-SAM2-Segment-Anything * https://github.com/lucasgelfond/webgpu-sam2 * https://github.com/microsoft/onnxruntime-inference-examples