segment-anything-model

Segment objects in images using point, box, or mask prompts.

2|7|Updated Jun 19, 2026
One-click install
npx skills add https://github.com/humanerd-drew/opencode-drewgent --skill segment-anything-model-humanerd-drew
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: segment-anything-model
Source: https://github.com/humanerd-drew/opencode-drewgent/tree/main/skills/mlops/models/segment-anything
Command: npx skills add https://github.com/humanerd-drew/opencode-drewgent --skill segment-anything-model-humanerd-drew

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill allows for zero-shot image segmentation, enabling users to segment any object in images without task-specific training.

Core Features & Use Cases

  • Zero-shot Segmentation: Segment any object in images without fine-tuning.
  • 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: Supports ViT-B (fastest), ViT-L, ViT-H (most accurate).
  • ONNX Export: Deploy in browsers and edge devices.
  • Use Cases: Suitable for interactive annotation tools, generating training data for other vision models, zero-shot transfer to new image domains, building object detection/segmentation pipelines, and processing medical, satellite, or domain-specific images.

Quick Start

Use the segment-anything-model skill to segment an object in the image 'example.jpg'.

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 without fine-tuning a model?

Zero-shot image segmentation can be performed using a pre-trained Vision Transformer model to segment any object in images without task-specific training. You can use point, bounding box, or previous mask prompts to isolate target objects.

What is the best way to generate object masks automatically for an entire image?

Automatic object mask generation is supported natively by the model, allowing you to produce all object masks for an image without providing manual prompts. This is useful for interactive annotation and generating training data for other vision models.

Does zero-shot segmentation work with PyTorch and Transformers frameworks?

Yes, zero-shot segmentation with this approach requires PyTorch and Transformers dependencies. It uses a pre-trained Vision Transformer architecture and integrates with the segment-anything library to process image prompts.

Can I use point and bounding box prompts for interactive image segmentation?

Point and bounding box prompts are fully supported for interactive image segmentation. The model accepts these flexible prompts alongside previous masks to accurately isolate specific objects within your target image.

Which Vision Transformer model sizes are available for object detection tasks?

Three Vision Transformer model sizes are available: ViT-B for the fastest processing, ViT-L for a balanced approach, and ViT-H for the highest accuracy in object detection and segmentation tasks.

How do I export image segmentation models for edge devices?

You can export the image segmentation models using ONNX format to deploy them in browsers and edge devices. This allows zero-shot segmentation capabilities to run efficiently outside of standard PyTorch environments.