Downloads · 30 days
0
mlx-community/SAM2.1-hiera-small-fp16
SAM2.1-hiera-small-fp16 is a image segmentation model from mlx-community. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
SAM 2.1 Hiera-Small, image mode (point / box → mask), converted to Apple MLX (fp16) from Meta's official sam2.1hierasmall.pt for the mlx-edgetam-swift Swift package (SAM21Package, an MLXEngine promptSegment ModelPacka…
Downloads · 30 days
0
Access
Public
Updated Sep 23, 2026
Parameters
38.5M
77.1 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors77.1 MB · 100%
From the Hugging Face model README
SAM 2.1 Hiera-Small, image mode (point / box → mask),
converted to Apple MLX (fp16) from Meta's official sam2.1_hiera_small.pt for the
mlx-edgetam-swift Swift package (SAM21Package, an MLXEngine
promptSegment ModelPackage).
no_mem_embed
(359 tensors, 38.5 M params). The video memory stack is not included.(O,kH,kW,I). The trunk's pos_embed and
pos_embed_window are (1,H,W,C). Converter: oracle/convert_sam21.py.SAM2ImagePredictor through set_image on the CPU fp32 stream.
On a 1024² flat-shaded image, a 1024² captioned copy and a 1200×800 synthetic page:
phys_footprint 2.4–2.8 GB.EdgeTAM (13.9 M params) is the fast default and handles video. On single clicks over flat-shaded or synthetic images, SAM 2.1-S is much better:
// .package(url: "https://github.com/xocialize/mlx-edgetam-swift", from: "0.6.0")
import EdgeTAM
let p = try EdgeTAMPredictor.fromPretrained(weightsPath, dtype: .float16) // Hiera detected from the weights
p.setImage(sourceCGImage)
let r = p.predict(point: (471, 635)) // r.mask, r.soft (anti-aliased), r.score
let boxed = p.predict(points: [], labels: [], box: [40, 245, 745, 910])
Or through MLXEngine: SAM21Package (MLXEdgeTAM), with mode: softMatte for an anti-aliased matte.
Weights: Apache-2.0 (facebookresearch/sam2). Port code: MIT.