SAM 2.1 small, 512 px, Core ML

SAM 2.1 video tracking of one object, as five Core ML programs with fixed shapes for Diffusion Studio. The programs compute in fp16 and take and give fp32. They need macOS 15.

Program Input Output
vision_encoder image features_stride4, features_stride8, features_stride16, features_seed
mask_decoder features_stride4, features_stride8, features, points field, score, iou, object_pointer
memory_encoder features_stride16, field, score, prompted memory
memory_attention features_stride16, memories, memory_rows, object_pointers, pointer_positions features
pointer_position distances pointer_positions
  • image is the frame, stretched to 512 Γ— 512. The program normalizes it.
  • points holds 16 rows of x, y and a label. x and y are in 0..1 of the frame. Label 1 is on the object, 0 is not, 2 and 3 are the corners of a box, and βˆ’1 is a row without a point.
  • features of the mask decoder is features_seed for a frame with points, and the output of memory_attention for a tracked frame.
  • field is the mask as logits, 128 Γ— 128.
  • memories holds 7 outputs of memory_encoder. memory_rows gives each one its row of the model's temporal table: row 6 for the frame with the points, and row k βˆ’ 1 for the k-th newest tracked frame.
  • distances are the frame distances of the 16 object pointers, divided by the largest distance that the pointers can have.

constants.json holds the sizes. convert.py in the crates/segmenter folder of Diffusion Studio makes these files.

Downloads last month
77
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for diffusionstudio/sam2.1-small-512-coreml

Quantized
(6)
this model