segment-anything-model

Segment objects in images using points, boxes, or masks.

3|1|Updated May 19, 2026
One-click install
npx skills add https://github.com/Quill-Agent/Quill-Agent --skill segment-anything-model-quill-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: segment-anything-model
Source: https://github.com/Quill-Agent/Quill-Agent/tree/main/skills/mlops/models/segment-anything
Command: npx skills add https://github.com/Quill-Agent/Quill-Agent --skill segment-anything-model-quill-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires segment-anything, transformers>=4.30.0, torch>=1.7.0, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill allows users to segment any object in images with zero-shot image segmentation via points, boxes, masks, providing flexibility and ease of use.

Core Features & Use Cases

  • Zero-shot Segmentation: Segment objects in any image domain without specific training.
  • Flexible Prompts: Use points, bounding boxes, or previous masks for segmentation.
  • Automatic Segmentation: Generate all object masks automatically.
  • High Quality: Trained on 1.1 billion masks from 11 million images.
  • Multiple Model Sizes: Choose between fast (ViT-B) and accurate (ViT-H) models.
  • ONNX Export: Deploy segmentation in browsers and edge devices.
  • Use Cases: Build object detection/segmentation pipelines, process medical, satellite, or domain-specific images, and generate training data for other vision models.

Quick Start

To segment an object in an image, first install the skill:

pip install git+https://github.com/facebookresearch/segment-anything.git

Then, use the following command:

from segment_anything import sam_model_registry, SamPredictor
sam = sam_model_registry["vit_h"](checkpoint="sam_vit_h_4b8939.pth")
predictor = SamPredictor(sam)
predictor.set_image("image.jpg")
input_point = np.array([[500, 375]])
masks, scores, logits = predictor.predict(point_coords=input_point, point_labels=np.array([1]))

Frequently Asked Questions about segment-anything-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform zero-shot image segmentation on objects without specific training data?

Zero-shot image segmentation identifies objects in any image domain without specific training by using points, boxes, or previous masks as prompts to generate high-quality masks. You can use points or bounding boxes to guide the segmentation model.

Can I use segment anything for medical or satellite image processing domains?

Yes, segment anything processes medical, satellite, or domain-specific images using zero-shot segmentation. It segments objects in any image domain without requiring specific training data for those particular fields.

What's the best way to generate training data for other vision models using image segmentation?

Generating training data for vision models uses automatic segmentation to create all object masks from images. These masks, generated via zero-shot segmentation, serve as training data for other computer vision models.

Do I need PyTorch and Transformers to run zero-shot image segmentation?

Yes, you need PyTorch (torch>=1.7.0) and Transformers (transformers>=4.30.0) installed. You also need the segment-anything library to execute the zero-shot image segmentation processing.

Does segment anything support ONNX export for deploying image segmentation on edge devices?

Segment anything supports ONNX export to deploy image segmentation in browsers and edge devices. You can convert the trained model for lightweight inference environments.

How do I choose between different model sizes for object detection and segmentation pipelines?

Choose between ViT-B for fast segmentation and ViT-H for accurate segmentation. Both model sizes integrate into object detection and segmentation pipelines depending on your speed and precision requirements.