Downloads · 30 days
13
18% of all-time downloads
robotflowlabs/sam2.1-hiera-large-int8
sam2.1-hiera-large-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-Large backbone) quantized to INT8 for real-time robotic segmentation. 1.7x smaller — from 1.7 GB to 1.0 GB — with both image and video segmentation capabilities preserved.
Downloads · 30 days
13
18% of all-time downloads
All-time downloads
71
Public
Parameters
217M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors868 MB · 80%
From the Hugging Face model README
Meta's Segment Anything Model 2.1 (Hiera-Large backbone) quantized to INT8 for real-time robotic segmentation. 1.7x smaller — from 1.7 GB to 1.0 GB — with both image and video segmentation capabilities preserved.
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.
Robotic manipulation and navigation require pixel-precise understanding of the scene. SAM2 is the state-of-the-art for promptable segmentation — given a point, box, or mask prompt, it segments any object in images or tracks it through video. But at 1.7 GB, deploying SAM2 alongside other perception models on edge hardware eats precious VRAM.
We quantized SAM2.1 to INT8 and exported weights in SafeTensors format so robots can run segmentation in real-time alongside depth estimation, feature extraction, and action generation — all on a single edge GPU.
| Property | Value |
|---|---|
| Architecture | Hiera-Large vision backbone + SAM2 decoder |
| Input Resolution | 1024 × 1024 |
| Capabilities | Image segmentation, video object tracking |
| 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-large |
| 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 | 1,713 MB | 1,038 MB | 1.7x smaller |
| INT8 Weights | — | 211 MB | Quantized linear layers |
| SafeTensors | — | 828 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-large-int8/
├── model_int8.pt # 211 MB — INT8 quantized state dict
├── model.safetensors # 828 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-large-int8")
processor = Sam2Processor.from_pretrained("facebook/sam2.1-hiera-large")
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-large")
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-large-int8")
masks = segmenter.segment(image, points=[[500, 375]])
SAM2 is the segmentation backbone across multiple ANIMA modules:
We provide all three SAM2.1 variants, optimized for different deployment scenarios:
| Model | Params | Size | Speed | Best For |
|---|---|---|---|---|
| sam2.1-hiera-large-int8 | Large | 1.0 GB | Highest quality | Research, high-accuracy tasks |
| sam2.1-hiera-small-int8 | Small | 186 MB | Balanced | Production robotics |
| sam2.1-hiera-tiny-int8 | Tiny | 152 MB | Fastest | Real-time edge, Jetson Nano |
ANIMA is a modular, ROS2-native agentic robotics platform developed by RobotFlowLabs. It combines 58 specialized AI modules — from perception and planning to manipulation and safety — into a unified system that enables robots to understand, reason, and act in unstructured real-world environments.
Every foundation model in ANIMA must run on edge hardware (Jetson Orin, industrial PCs) under real-time constraints. That's why we built FORGE — our compression and distillation pipeline — and why we're releasing optimized model variants publicly.
We believe the robotics community deserves production-ready models, not just research checkpoints.
Original SAM2.1 Hiera-Large (FP32, 1.7 GB)
│
├─→ torchao INT8 dynamic quantization (GPU-native)
│ └─→ model_int8.pt (211 MB)
│
└─→ SafeTensors export (roi_align not ONNX-compatible)
└─→ model.safetensors (828 MB)
torchao on NVIDIA L4 GPUfacebook/sam2.1-hiera-large 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}
}