Instructions to use facebook/sam-vit-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/sam-vit-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("mask-generation", model="facebook/sam-vit-base")# Load model directly from transformers import AutoProcessor, AutoModelForMaskGeneration processor = AutoProcessor.from_pretrained("facebook/sam-vit-base") model = AutoModelForMaskGeneration.from_pretrained("facebook/sam-vit-base") - Notebooks
- Google Colab
- Kaggle
Add a missing example notebook link
#10
by s-takahashi-st - opened
README.md
CHANGED
|
@@ -68,7 +68,7 @@ masks = processor.image_processor.post_process_masks(outputs.pred_masks.cpu(), i
|
|
| 68 |
scores = outputs.iou_scores
|
| 69 |
```
|
| 70 |
Among other arguments to generate masks, you can pass 2D locations on the approximate position of your object of interest, a bounding box wrapping the object of interest (the format should be x, y coordinate of the top right and bottom left point of the bounding box), a segmentation mask. At this time of writing, passing a text as input is not supported by the official model according to [the official repository](https://github.com/facebookresearch/segment-anything/issues/4#issuecomment-1497626844).
|
| 71 |
-
For more details, refer to this notebook, which shows a walk throught of how to use the model, with a visual example!
|
| 72 |
|
| 73 |
## Automatic-Mask-Generation
|
| 74 |
|
|
|
|
| 68 |
scores = outputs.iou_scores
|
| 69 |
```
|
| 70 |
Among other arguments to generate masks, you can pass 2D locations on the approximate position of your object of interest, a bounding box wrapping the object of interest (the format should be x, y coordinate of the top right and bottom left point of the bounding box), a segmentation mask. At this time of writing, passing a text as input is not supported by the official model according to [the official repository](https://github.com/facebookresearch/segment-anything/issues/4#issuecomment-1497626844).
|
| 71 |
+
For more details, refer to [this notebook](https://github.com/huggingface/notebooks/blob/main/examples/segment_anything.ipynb), which shows a walk throught of how to use the model, with a visual example!
|
| 72 |
|
| 73 |
## Automatic-Mask-Generation
|
| 74 |
|