whatisgithub

What is instructsam?

dcdmllm/instructsam — explained in plain English

Analysis updated 2026-05-18

73PythonAudience · researcherComplexity · 4/5Setup · hard

In one sentence

A research model that segments individual objects in an image from a plain-language description, category name, or reasoning-style question.

Mindmap

mindmap
  root((InstructSAM))
    What it does
      Text prompted segmentation
      Per object outlines
      Reasoning style queries
    Tech stack
      Python
      PyTorch
      Hugging Face
    Use cases
      Research segmentation
      Try pretrained weights
      Run on single images
    Requirements
      Python 3.10
      flash attn build
      GPU required

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate pixel-level object outlines from a plain-language description instead of manual labeling.

USE CASE 2

Segment individual matching objects separately rather than one blurry combined region.

USE CASE 3

Use pre-trained weights from Hugging Face to try the model without running training first.

What is it built with?

PythonPyTorchHugging Face

How does it compare?

dcdmllm/instructsampalaiologos1453/openinterviewyuecheng919/gemdepth
Stars737373
LanguagePythonPythonPython
Setup difficultyhardmoderate
Complexity4/53/55/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires a Python 3.10 environment, compiling flash-attn from source, and a GPU to run.

The README does not state a license, so usage rights are unclear.

So what is it?

This is a research project that lets you point an AI model at an image and describe, in plain language, what you want highlighted. You can name a category such as "cat", write a phrase referring to a specific thing such as "the woman in the red jacket", or pose a reasoning-style question. The model returns pixel-level outlines for each individual matching object in the image, rather than a single blurry region covering everything that fits the description. The system is built on a vision-and-language model with two billion parameters and is trained in two stages. The first stage teaches the model to follow instructions and produce segmentation masks. The second stage, described as reasoning fine-tuning, improves its ability to handle more complex or indirect descriptions. Both training scripts and evaluation scripts are included in the repository. The training data, called Inst2Seg, and a benchmark dataset are published on Hugging Face. To run the model on a single image, you provide an image path and a text query. The script prints the generated text and mask confidence scores, then writes image files showing the masks overlaid on the original photo. Pre-trained model weights are available on Hugging Face, so you do not need to run training yourself to try the model. Setup requires creating a Python 3.10 environment and installing several packages. One of them, flash-attn, requires compilation from source. A GPU is necessary for running the model. The project was released in May 2026 and links to an accompanying research paper on arXiv.

Copy-paste prompts

Prompt 1
Explain the difference between instance segmentation and simple region highlighting in computer vision.
Prompt 2
How do the two training stages in InstructSAM, instruction tuning and reasoning fine-tuning, differ?
Prompt 3
Walk me through setting up a Python 3.10 environment with flash-attn compiled from source.
Prompt 4
How would I run InstructSAM on a single image with a text query and interpret the output masks?

Frequently asked questions

What is instructsam?

A research model that segments individual objects in an image from a plain-language description, category name, or reasoning-style question.

What language is instructsam written in?

Mainly Python. The stack also includes Python, PyTorch, Hugging Face.

What license does instructsam use?

The README does not state a license, so usage rights are unclear.

How hard is instructsam to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is instructsam for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.