Skip to content
imaged

Prompt-driven segmentation

SAM ViT-B

Meta's original SAM ViT-B for higher-quality masks when latency is fine.

Apache-2.0
Explore model

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 app

Model files are being prepared.

Explore the model’s examples, source links, and integration notes while download variants are added.

Example inference

Input
A hatchback photographed on a city street.
Output
The same car with the SAM ViT-B mask overlaid in color.

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

Catalog reference · variant unspecifiedCold start (ms): 13453.76

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

Catalog reference · variant unspecified

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}));