File size: 668 Bytes
e6ad8cd 8595d84 e6ad8cd e34711c e6ad8cd e34711c 28c7e68 e34711c e6ad8cd b0d2488 e34711c e6ad8cd e34711c e6ad8cd e34711c e6ad8cd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
---
pipeline_tag: mask-generation
---
# MobileSAM model
This model repository contains the weights of the MobileSAM model.
## Installation
First install the MobileSAM package:
```bash
git clone -b add_mixin https://github.com/NielsRogge/MobileSAM.git
cd MobileSAM
```
## Usage
The model can then be used as follows:
```python
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>)
``` |