segment-anything-model

Generate object masks from point, box, or mask prompts without fine-tuning.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MarbleSodas/Mavis --skill segment-anything-model-marblesodas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: segment-anything-model
Source: https://github.com/MarbleSodas/Mavis/tree/main/skills/mlops/models/segment-anything
Command: npx skills add https://github.com/MarbleSodas/Mavis --skill segment-anything-model-marblesodas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires segment-anything, transformers, torch, opencv-python, pycocotools, matplotlib, onnxruntime, onnx, groundingdino-py, tensorrt, pycuda, and includes references (resource) components.

What problem does it solve?

It solves the challenge of segmenting objects in images accurately without needing task-specific training data or labeled datasets.

Core Features & Use Cases

  • Zero-shot image segmentation (SAM): Generate masks for arbitrary objects using point, box, or mask prompts.
  • Interactive annotation workflows: Build click-to-segment tools where users refine results iteratively.
  • Automatic mask generation: Produce many candidate masks for downstream filtering, datasets, or quick proposals.

Use case: You need to annotate a new dataset for a custom object category; use point prompts to quickly generate high-quality masks, then export or refine them for training data.

Quick Start

Use the segment-anything-model to generate a segmentation mask for an object in image.jpg by specifying a foreground point and selecting the highest-scoring predicted mask.

Frequently Asked Questions about segment-anything-model

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

FAQPage Schema
How do I generate object masks from images without task-specific training data?

You can perform zero-shot image segmentation by providing interactive point, box, or mask prompts to generate precise object masks without needing task-specific training data or fine-tuning.

Can I use zero-shot segmentation for automated image annotation workflows?

Yes, you can build interactive annotation workflows using zero-shot segmentation to produce candidate masks for dataset creation, enabling click-to-segment tools where users iteratively refine results for training data.

Does zero-shot image segmentation support ONNX export for deployment?

Yes, zero-shot image segmentation supports optional ONNX export for deployment. It includes checkpoint loading and prompt-based inference using points, boxes, or masks, enabling execution via ONNX runtime in production pipelines.

What is the best way to segment custom object categories for a new dataset?

The best way is using prompt-based zero-shot inference. You specify foreground points on target objects within images to generate high-scoring masks, then export or refine those masks to quickly build datasets for custom categories.

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

Yes, running zero-shot image segmentation requires PyTorch, OpenCV, transformers, and pycocotools. These dependencies provide the foundational tensor operations, image processing, and mask annotation capabilities needed for inference.

When should I not use zero-shot segmentation for computer vision pipelines?

You should avoid zero-shot segmentation if your computer vision pipeline requires fine-tuned masks for highly specialized edge cases. It is designed for still-image domains and generates proposals without task-specific training data.