Prompt-driven segmentation
SAM ViT-B
Meta's original SAM ViT-B for higher-quality masks when latency is fine.
About this model
SAM ViT-B is the base-size variant of Meta's Segment Anything. The encoder is 359 MB with 91M parameters; the decoder is 16 MB. Same prompt-driven I/O as MobileSAM. Mask boundaries differ by under 1% on the test fixture compared to MobileSAM.
On M1 Max CPU, the first call takes 13 seconds because the encoder must load. Re-prompting on the same cached image takes 84 ms. Use this for offline work and dataset labeling.
What you can build
- Label datasets where mask boundary quality matters.
- Cut hairlines and fine details from product photos in a batch tool.
- Generate ground-truth masks for training a smaller segmenter.
- Re-mask one-off images where the cold start is fine.
Variants & downloads
Choose the build for your appModel files are being prepared.
Explore the model’s examples, source links, and integration notes while download variants are added.
Example inference
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
M1 Max, macOS 15, ONNX Runtime 1.17
See original catalog hardware notes · CPU
83.8 ms
Warm inference
Reference result from the existing catalog; conversion variant and measurement date were not recorded.
RTX 2060, Ubuntu 24.04, ONNX Runtime 1.24.3
See original catalog hardware notes · CUDA
9.8 ms
Warm inference
Reference result from the existing catalog; conversion variant and measurement date were not recorded.
Integration examples
Vision SDK integration
cpp
#include "imaged/sdk.hpp"
#include "imaged/families/sam/sam_family.hpp"
imaged::SDK::AI ai;
auto& config = ai.getOptions();
config.set("sam.encoder.model", "weights/sam_vit_b_01ec64.encoder.onnx");
config.set("sam.decoder.model", "weights/sam_vit_b_01ec64.decoder.onnx");
imaged::SDK::SamFamily family;
family.load(config);
imaged::SDK::Image image;
image.load("scene.jpg");
imaged::SDK::PointPromptInput prompt;
prompt.image = ℑ
prompt.points.push_back({600.f, 350.f, 1});
auto result = std::get<imaged::SDK::DetectionResult>(family.run({prompt}));