SAM serves as a powerful foundation model for segmentation as it has large data coverage. It is trained on 
SA-1B, a dataset with 1 million images and 1.1 billion masks. 
In this guide, you will learn how to:
- Infer in segment everything mode with batching,
- Infer in point prompting mode,
- Infer in box prompting mode.
First, let's install transformers:

pip install -q transformers
Mask Generation Pipeline
The easiest way to infer mask generation models is to use the mask-generation pipeline.
thon