# tianrun-chen/SAM-Adapter-PyTorch

Adapting Meta AI's Segment Anything to Downstream Tasks with Adapters and Prompts

Repository: https://github.com/tianrun-chen/SAM-Adapter-PyTorch
Canonical: https://ross.abutalabs.com/products/sam-adapter-pytorch
Language: Python
License: MIT
License Family: permissive
Topics: 2d-segmentation, adapter, camouflage-images, camouflaged-object-detection, camouflaged-target-detection, fine-tune, fine-tuning, image-segmentation, image-segmentation-pytorch, segment-anything, segment-anything-model
Last push: 2026-05-17T04:56:00+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 82, release rhythm 35, longevity 88
- inputs: {"age_days": 1237, "days_push": 108, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1551, forks 123 (observed 2026-08-28T04:05:02.195630+00:00)

## What it is
A PyTorch library that adapts Meta AI's Segment Anything Model (SAM, SAM2, SAM3) to underperforming downstream segmentation tasks using lightweight adapters and prompts. It provides training and evaluation pipelines for tasks like camouflaged object detection, shadow detection, and medical image segmentation.

## Use cases
- fine-tune segment anything model on my own dataset
- segment camouflaged objects in images
- adapt SAM for medical image segmentation
- polyp segmentation from endoscopy images
- shadow detection with segment anything
- train SAM adapter with distributed training on multiple GPUs
- use SAM2 or SAM3 backbone for downstream segmentation

## When to choose
- you need to adapt SAM/SAM2/SAM3 to a specialized segmentation domain where the base model underperforms
- you want a lightweight adapter-based fine-tuning approach instead of full model retraining
- you work on camouflaged object detection, shadow removal, or medical segmentation tasks

## When to avoid
- you only need general-purpose promptable segmentation without domain adaptation
- you lack access to high-memory GPUs, since training requires multiple large-memory cards
- you need a production-ready inference service rather than a research codebase

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, image-processing, computer-vision
- domain: computer-vision, image-processing, machine-learning, deep-learning
- platform: python
- tags: segment-anything, sam-adapter, fine-tuning, image-segmentation, camouflaged-object-detection, medical-imaging, pytorch, iccv-2023, gpu

## Member repositories
- tianrun-chen/SAM-Adapter-PyTorch (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:02.195630+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:30:17.320596+00:00, confidence not recorded.
  - readme: https://github.com/tianrun-chen/SAM-Adapter-PyTorch (fetched 2026-08-28T04:05:02.195630+00:00, sha 0efa8aa2c69a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
