图像编辑与放大Apache-2.0Python

SAM 2

Segment Anything for images and video, with object tracking.

Star 数
20K
Fork 数
2.6K
未关闭 Issue
488
最近提交
2026-05-30

数据来自 GitHub API · 更新于 2026-10-15

SAM 2 是什么?

SAM 2 extends Segment Anything to video: prompt an object once and it is tracked and masked across frames. It is faster than SAM on images and is used for rotoscoping and video editing pipelines.

主要功能

  • Promptable image and video segmentation
  • Object tracking across frames
  • Multiple model sizes

系统要求

平台
Linux · Windows · macOS
显卡
NVIDIA recommended
Python
3.10+
备注
PyTorch 2.5.1+ per the README.

如何安装 SAM 2

根据项目 README 整理。开源项目更新很快,请以 GitHub 页面上的最新说明为准。

From source

  1. 1
    Clone and install.
    git clone https://github.com/facebookresearch/sam2.git
    cd sam2
    pip install -e .
  2. 2
    Download checkpoints.
    cd checkpoints && ./download_ckpts.sh

优势

  • Works on video
  • Faster than SAM

不足

  • Developer-oriented

SAM 2 替代品对比

软件Star 数许可证平台显存
SAM 2

Segment Anything for images and video, with object tracking.

20KApache-2.0—
Segment Anything (SAM)

Meta’s promptable segmentation model — click to cut out any object.

55KApache-2.0—
BiRefNet

High-resolution dichotomous segmentation — state-of-the-art background removal.

4.3KMIT—
Upscayl

Free desktop app that upscales images with AI.

50.6KAGPL-3.0—
Real-ESRGAN

Practical image and video super-resolution models.

37.1KBSD-3-Clause—
GFPGAN

Blind face restoration for old and low-quality photos.

37.7KApache-2.0—

常见问题

SAM 2 免费吗?

是的——SAM 2 是开源软件,采用 Apache-2.0 许可证。商用前请确认软件及模型权重的许可条款。

SAM 2 支持 Windows、Mac 和 Linux 吗?

SAM 2 支持:Linux, Windows, macOS。

运行 SAM 2 需要什么配置?

NVIDIA recommended

如何安装 SAM 2?

1. Clone and install. 2. Download checkpoints.

SAM 2 有哪些好的替代品?

常见替代品包括 Segment Anything (SAM), BiRefNet, Upscayl, Real-ESRGAN,详见本页对比表。

可以不安装、在线使用 SAM 2 吗?

如果只想要结果,AiLoft 可在浏览器中运行 GPT Image 2.5、Nano Banana Pro 等顶级图像模型,无需显卡和配置。

不想安装?直接在浏览器里生成图片

无需显卡、驱动或 Python。在线使用 GPT Image 2.5 和 Nano Banana Pro,并排对比效果。