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
State_dict mismatch with the original model
#4
by max-fofanov - opened
It seems, that this model contains one more parameter, then the original model from https://github.com/facebookresearch/segment-anything. Why so and if it is normal, can you please provide a conversion script?
Hi @max-fofanov
Please find the conversion script we used to create the checkpoints here: https://github.com/huggingface/transformers/blob/main/src/transformers/models/sam/convert_sam_original_to_hf_format.py
Thank you very much!
max-fofanov changed discussion status to closed