sam2.1-hiera-tiny-ONNX (FP16)

FP16 ONNX models for Meta SAM 2.1 Hiera Tiny at the repository root, for mobile ONNX Runtime inference (used by ipsilondev apps: image encoder once per photo, prompt encoder + mask decoder once per tap).

Provenance and licence

  • Upstream model: facebook/sam2.1-hiera-tiny, Meta Platforms, Inc., Apache-2.0.
  • ONNX conversion: onnx-community/sam2.1-hiera-tiny-ONNX, Apache-2.0 (this repository's base_model).
  • This repository: the two FP16 graphs of that conversion as single self-contained ONNX files (no external onnx_data), unchanged weights. The licence of this repository is therefore Apache-2.0; keep the upstream notices when you redistribute.

Files

file bytes SHA-256
vision_encoder_fp16.onnx 67,313,499 f4ca896cf99816ad0cb7062e9ebef44a211e6f0d0a0656a7eb13349204cb6caa
prompt_encoder_mask_decoder_fp16.onnx 10,678,872 3b63240a6cb10fa62485b9a672093974dc881268c90b700687bf9c07aab33392

preprocessor_config.json, processor_config.json and config.json come from the upstream conversion.

Tensor names (read with the onnx Python package, opset 18)

vision_encoder_fp16.onnx (image encoder)

Inputs

name dtype shape
pixel_values float32 [batch_size, 3, 1024, 1024]

Outputs

name dtype shape
image_embeddings.0 float32 [batch_size, 32, 256, 256]
image_embeddings.1 float32 [batch_size, 64, 128, 128]
image_embeddings.2 float32 [batch_size, ?, ?, ?]

prompt_encoder_mask_decoder_fp16.onnx (prompt encoder + mask decoder)

Inputs

name dtype shape
input_points float32 [batch_size, 1, num_points_per_image, 2]
input_labels int64 [batch_size, 1, num_points_per_image]
input_boxes float32 [batch_size, num_boxes_per_image, 4]
image_embeddings.0 float32 [batch_size, 32, 256, 256]
image_embeddings.1 float32 [batch_size, 64, 128, 128]
image_embeddings.2 float32 [batch_size, 256, 64, 64]

Outputs

name dtype shape
iou_scores float32 [batch_size, num_boxes_or_points, 3]
pred_masks float32 [batch_size, num_boxes_or_points, num_masks, ?, ?]
object_score_logits float32 [batch_size, num_boxes_or_points, 1]

Usage notes

  • Pre-processing: resize the RGB image to 1024x1024 (stretched, no padding), scale to 0..1, normalise with mean [0.485, 0.456, 0.406] and std [0.229, 0.224, 0.225], layout NCHW.
  • Prompts are in the 1024x1024 frame; input_labels 1 = foreground, 0 = background; input_boxes may be empty ([1, 0, 4]).
  • The decoder returns three candidate masks (pred_masks [1, 1, 3, 256, 256] logits, positive = inside) with predicted IoU scores (iou_scores [1, 1, 3]) and object_score_logits.
  • Post-processing (sigmoid, upsampling, edge refinement) is up to the application.
Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ipsilondev/sam2.1-hiera-tiny-ONNX

Quantized
(1)
this model