PABannier

Fast state-of-the-art image and video segmentation in portable C/C++

90
5
100% credibility
Found Apr 08, 2026 at 90 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
C++
AI Summary

sam3.cpp provides a lightweight C/C++ library for running advanced AI models to segment objects in images and videos using text prompts, points, or boxes on CPU or Apple hardware.

How It Works

1
🖼️ Discover smart cutting tool

You find sam3.cpp, a simple program that lets you automatically cut out people, animals, or objects from photos and videos right on your computer.

2
📥 Grab the files

Download the ready-to-use files from the project page to your computer.

3
🛠️ Set it up easily

Follow the friendly guide to prepare everything on your Mac or PC so it's ready to go.

4
🧠 Add a smart model

Pick a lightweight model file that teaches the program to recognize everyday objects and download it.

5
Choose your task
📷
Cut from photo

Load your picture and start selecting objects.

🎬
Track in video

Open your video and follow moving objects frame by frame.

6
Select with clicks or words

Click points on objects, draw boxes, or type words like 'cat' to magically outline and separate them perfectly.

🎉 Export your results

Save clean cutouts or tracked masks to use in your projects, edits, or fun creations.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 90 to 90 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is sam3.cpp?

sam3.cpp ports Meta's latest Segment Anything models—SAM 3, SAM 2.1, SAM 2, and EdgeTAM—to a single portable C/C++ library for fast image and video segmentation. It runs inference on CPU or Apple Metal with no Python, PyTorch, or GPU drivers required, supporting text prompts like "cat" for zero-click detection, point/box prompts, and video object tracking. Developers compile once and get quantized models down to 15MB for real-time use.

Why is it gaining traction?

It stands out by slashing dependencies to zero beyond a C++14 compiler, delivering state-of-the-art segmentation at speeds like 0.4s per frame on EdgeTAM (Metal) versus minutes in Python. Benchmarks on Apple M4 Pro show SAM 2.1 tiny at 22MB hitting 0.9s/frame, with easy quantization tools and interactive SDL2 demos for quick testing. The C++ API handles multi-mask output and memory banks for tracking, making it a drop-in for performance-critical apps.

Who should use this?

C++ devs building mobile AR apps, embedded robotics, or real-time video editors needing on-device segmentation without cloud or Python runtimes. Ideal for iOS/macOS teams leveraging Metal accel, or anyone prototyping fast GitHub runners for image processing pipelines.

Verdict

Grab it if you need portable, fast C/C++ segmentation—docs and benchmarks are solid for an early project. With 90 stars and 1.0% credibility score, it's immature but promising; test the tiny models first before production.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.