Model weights · MobileSAM

Download MobileSAM weights

SAM with its heavy image encoder distilled into a tiny one, keeping the same prompt-based masks while shrinking to a size that runs on phones and edge devices. Pick a size below and download the official .pt checkpoint in one click, with published parameters, size and license all in view.

Apache-2.0AGPL-3.0 via UltralyticsKyung Hee University · 2023 · Ultralytics (PyTorch)

MobileSAM checkpoints, pick a size and download

SAM with its heavy image encoder distilled into a tiny one, keeping the same prompt-based masks while shrinking to a size that runs on phones and edge devices.

Using it with the Ultralytics package?

The MobileSAM weights are Apache-2.0, but the Ultralytics package that most people load them with is AGPL-3.0. Running MobileSAM through Ultralytics puts your own project under AGPL-3.0 too, which means publishing your source if you distribute it or offer it over a network. An Ultralytics Enterprise license removes that. The Apache-2.0 terms only cover you if you run the weights outside the Ultralytics package.

  • MobileSAM
    mobile_sam.pt
    Params
    10.1M
    Size
    39 MB

Figures are published by the authors. Weights host: github.com. Clicking Download verifies the file and starts it straight from the official CDN.

How to load MobileSAM weights

Install the Ultralytics package, then point the loader at the checkpoint. It downloads automatically on first use, or you can pass the local path to the file you downloaded above.

pip install ultralytics
from ultralytics import SAM

# Downloads on first use, or pass a local path to your .pt file
model = SAM("mobile_sam.pt")
results = model("image.jpg")

Want to see the architecture? Export to ONNX and open it in the ONNX visualizer for a labelled diagram with shapes and parameter counts.

Open visualizer →

Choosing a MobileSAM checkpoint

Read off the table above: what each step up the size ladder costs and returns for this family specifically, where it stops being worth it, and what the license actually permits.

Licensing, in practice

The weights are Apache-2.0. More importantly, the usual way to run MobileSAM is through the `ultralytics` package, which is AGPL-3.0, and that reaches your application even though the weights themselves are not. A permissive badge on the weights is not permission to ship closed-source over that path. Apache-2.0 on the weights is commercial-friendly and needs only attribution.

About MobileSAM

MobileSAM replaces SAM's heavy ViT-H image encoder with a lightweight one distilled from the original, cutting the model to a fraction of the size while keeping the same promptable mask decoder, so it runs on mobile and edge hardware. A single 40 MB checkpoint under permissive Apache-2.0 licensing.

Author
Kyung Hee University
Released
2023
Tasks
Segment
Framework
Ultralytics (PyTorch)
Input size
1024px
License
Apache-2.0
Blog

From the blog

Tutorials, code, and notes on computer vision, deep learning, and applied AI.

Frequently asked questions

How do I download MobileSAM weights?
Click the Download button next to any variant in the table above; we verify the file and start it straight from the official CDN. You can also let the loader fetch it automatically on first use with `model = SAM("mobile_sam.pt")`. All 1 MobileSAM checkpoint is hosted officially.
Is MobileSAM free for commercial use?
MobileSAM is released under Apache-2.0. Apache-2.0 is permissive and commercial-friendly: you can use it in closed-source products with attribution. Always confirm against the linked license text.
Which MobileSAM model size should I use?
Start with MobileSAM, the smallest and fastest, ideal for prototyping, edge and CPU. Move up the ladder only when you need more accuracy and have the compute for it.