Downloads · 30 days
15
20% of all-time downloads
robotflowlabs/sam2.1-hiera-tiny-int8
sam2.1-hiera-tiny-int8 is a image segmentation model from robotflowlabs. 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 transformers. The card lists the license as apache-2.0.
Meta's Segment Anything Model 2.1 (Hiera-Tiny backbone) quantized to INT8 for real-time robotic segmentation. 2.0x smaller — from 298 MB to 152 MB — the smallest SAM2 variant for maximum speed on edge hardware.
Downloads · 30 days
15
20% of all-time downloads
All-time downloads
74
Public
Parameters
31.4M
159 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors126 MB · 79%
From the Hugging Face model README
Meta's Segment Anything Model 2.1 (Hiera-Tiny backbone) quantized to INT8 for real-time robotic segmentation. 2.0x smaller — from 298 MB to 152 MB — the smallest SAM2 variant for maximum speed on edge hardware.
This model is part of the RobotFlowLabs model library, built for the ANIMA agentic robotics platform — a modular ROS2-native AI system that brings foundation model intelligence to real robots operating in the real world.
When every millisecond counts — grasping a moving object, dodging an obstacle, responding to a human — you need the fastest possible segmentation. SAM2 Hiera-Tiny is the lightest SAM2 backbone, and at 152 MB after INT8 quantization, it fits comfortably alongside multiple other perception models on devices like Jetson Nano or Orin NX.
| Property | Value |
|---|---|
| Architecture | Hiera-Tiny vision backbone + SAM2 decoder |
| Input Resolution | 1024 × 1024 |
| Capabilities | Image segmentation, video object tracking |
| Backbone Stages | 4 stages: [1, 2, 7, 2] blocks (12 total) |
| Embed Dims | [96, 192, 384, 768] per stage |
| Attention Heads | [1, 2, 4, 8] per stage |
| Global Attention | Blocks 5, 7, 9 |
| Mask Decoder | 256-dim hidden, 8 attention heads, 3 multi-mask outputs |
| Memory Attention | 4 layers, 2048-dim FFN, RoPE positional encoding |
| Memory Bank | 7 frames temporal context |
| Original Model | facebook/sam2.1-hiera-tiny |
| License | Apache-2.0 |
Quantized on an NVIDIA L4 24GB GPU using INT8 dynamic quantization with SafeTensors export.
| Metric | Original | INT8 Quantized | Change |
|---|---|---|---|
| Total Size | 298 MB | 152 MB | 2.0x smaller |
| INT8 Weights | — | 32 MB | Quantized linear layers |
| SafeTensors | — | 120 MB | Full model weights |
| Quantization | FP32 | INT8 Dynamic | Per-tensor symmetric |
| Format | PyTorch | SafeTensors + INT8 .pt | Dual format |
Why SafeTensors instead of ONNX? SAM2 uses custom CUDA operations (roi_align, deformable attention) that aren't supported by the ONNX standard. SafeTensors provides fast, safe loading directly into PyTorch with zero-copy memory mapping.
sam2.1-hiera-tiny-int8/
├── model_int8.pt # 32 MB — INT8 quantized state dict
├── model.safetensors # 120 MB — Full model in SafeTensors format
├── config.json # Model configuration
├── preprocessor_config.json # Image preprocessing config
└── README.md # This file
from transformers import Sam2Model, Sam2Processor
import torch
# Load with SafeTensors (automatic)
model = Sam2Model.from_pretrained("robotflowlabs/sam2.1-hiera-tiny-int8")
processor = Sam2Processor.from_pretrained("facebook/sam2.1-hiera-tiny")
model.to("cuda").eval()
# Segment with point prompt
inputs = processor(
images=image,
input_points=[[[500, 375]]], # (x, y) point prompt
return_tensors="pt"
).to("cuda")
with torch.no_grad():
outputs = model(**inputs)
masks = processor.post_process_masks(
outputs.pred_masks,
inputs["original_sizes"],
inputs["reshaped_input_sizes"]
)
import torch
from transformers import Sam2Model
# Load architecture, then apply INT8 weights
model = Sam2Model.from_pretrained("facebook/sam2.1-hiera-tiny")
int8_state = torch.load("model_int8.pt", map_location="cuda", weights_only=True)
model.load_state_dict(int8_state, strict=False)
from forge.vision import VisionEncoderRegistry
# FORGE handles optimal loading and batching
segmenter = VisionEncoderRegistry.load("sam2.1-hiera-tiny-int8")
masks = segmenter.segment(image, points=[[500, 375]])
SAM2-Tiny is optimized for latency-critical deployments:
We provide all three SAM2.1 variants, optimized for different deployment scenarios:
| Model | Size | Speed | Best For |
|---|---|---|---|
| sam2.1-hiera-large-int8 | 1.0 GB | Highest quality | Research, high-accuracy tasks |
| sam2.1-hiera-small-int8 | 186 MB | Balanced | Production robotics |
| sam2.1-hiera-tiny-int8 | 152 MB | Fastest | Real-time edge, Jetson Nano |
Original SAM2.1 Hiera-Tiny (FP32, 298 MB)
│
├─→ torchao INT8 dynamic quantization (GPU-native)
│ └─→ model_int8.pt (32 MB)
│
└─→ SafeTensors export (roi_align not ONNX-compatible)
└─→ model.safetensors (120 MB)
torchao on NVIDIA L4 GPUfacebook/sam2.1-hiera-tiny by Meta AI (FAIR)@article{ravi2024sam2,
title={SAM 2: Segment Anything in Images and Videos},
author={Ravi, Nikhila and Gabeur, Valentin and Hu, Yuan-Ting and Hu, Ronghang and Ryali, Chaitanya and Ma, Tengyu and Khedr, Haitham and R{\"a}dle, Roman and Rolber, Chloe and Gustafson, Laura and others},
journal={arXiv preprint arXiv:2408.00714},
year={2024}
}
@misc{robotflowlabs2026anima,
title={ANIMA: Agentic Networked Intelligence for Modular Autonomy},
author={RobotFlowLabs},
year={2026},
url={https://huggingface.co/robotflowlabs}
}