Downloads · 30 days
348
8% of all-time downloads
nielsr/mobilesam
mobilesam is a mask generation model from nielsr. Use it for the mask generation task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model repository contains the weights of the MobileSAM model.
Downloads · 30 days
348
8% of all-time downloads
All-time downloads
4.3K
Public
Parameters
10.1M
81.3 MB on disk
Likes
7
Public
Click a slice to open those files.
.bin40.7 MB · 50%
From the Hugging Face model README
This model repository contains the weights of the MobileSAM model.
First install the MobileSAM package:
git clone -b add_mixin https://github.com/NielsRogge/MobileSAM.git
cd MobileSAM
The model can then be used as follows:
from mobile_sam import MobileSAM, SamPredictor
import torch
model = MobileSAM.from_pretrained("nielsr/mobilesam")
# perform inference
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device=device)
predictor = SamPredictor(model)
predictor.set_image(<your_image>)
masks, _, _ = predictor.predict(<input_prompts>)