LibreAI / Image / SAM 2
// image · facebookresearch/sam2

SAM 2

SAM 2 est un projet de image open source, créé par facebookresearch (facebookresearch/sam2 sur GitHub). Il compte 20 061 étoiles sur GitHub et 2 581 forks, il est publié sous la licence Apache-2.0 et a été mis à jour pour la dernière fois sur GitHub le 30 mai 2026.

SAM 2 — Meta's Segment Anything Model 2: promptable segmentation for images and video, Apache-2.0

★ 20,1 k étoiles⑂ 2,6 k forksApache-2.0mis à jour mai 2026
▦ visuel — le README de ce projet ne contient aucune capture intégrable,
voici donc un emplacement réservé. Le guide ci-dessous est complet malgré tout.
// détails du projet

Détails du projet

Étoiles GitHub
20 061
Forks
2 581
Licence
Apache-2.0
Dernière mise à jour sur GitHub
30 mai 2026
Catégorie
Image
Type de fiche
Guide d'installation complet
// fonctionnement

Comment ça marche

  1. Install PyTorch and TorchVision first

    SAM 2 needs Python 3.10+, torch 2.5.1+ and torchvision 0.20.1+ — install those from the PyTorch site before anything else.

  2. Clone and install SAM 2

    Clone the repo and install it in editable mode; add the notebooks extra for the example notebooks.

  3. Download checkpoints and segment

    Download a SAM 2 checkpoint, then run image or video prediction with the predictor from the example notebooks.

// fonctionnalités

Pourquoi on l'adore

Promptable segmentation

Point, box or mask prompts select exactly the object you mean — no training on your subject required.

Images and video

The step beyond SAM 1: the same model tracks a segmented object across video frames.

Example notebooks included

Image prediction and video prediction notebooks show the full workflow, with jupyter and matplotlib as the only extras.

A foundation for editing tools

Segmentation masks feed background removal, object cut-out, inpainting and video effects pipelines.

Advertisement
// lancez-le

Lancez-le vous-même

  1. Install

    The README install route: clone, then editable install.

    git clone https://github.com/facebookresearch/sam2.git && cd sam2
    pip install -e .
  2. Add the notebooks

    Required for the example notebooks (jupyter and matplotlib).

    pip install -e ".[notebooks]"
  3. Download checkpoints

    Checkpoints are separate from the code — download them per the README Getting Started section, then run image or video prediction.

    https://github.com/facebookresearch/sam2#getting-started
// cas d'usage

Ce que vous pouvez créer

Advertisement
// faq

Questions fréquentes

Who makes SAM 2?

Meta's Facebook Research team, as the successor to the Segment Anything Model.

Is SAM 2 free?

Yes — Apache-2.0 licensed code; checkpoints carry their own licence terms.

How is SAM 2 different from SAM 1?

SAM 2 adds video: it segments and tracks objects across frames, where SAM 1 handled single images.

Do I need a GPU?

For practical use, yes — the install compiles a custom CUDA kernel, and the README recommends a GPU machine (WSL on Windows).

How do I get started?

Install PyTorch 2.5.1+ and TorchVision, clone and pip install -e ., download a checkpoint, and follow the image or video prediction notebooks.

// continuez l'exploration

Outils similaires

Image

Real-ESRGAN

Real-ESRGAN — practical blind super-resolution for real-world photos and video: restores and upscales degraded images with models trained on pure synthetic data, BSD-3-Clause

★ 37,1 k étoilesBSD-3-Clause
Voir le guide →
Image

backgroundremover

Background Remover lets you Remove Background from images and video using AI with a simple command line interface that is free and open source.

★ 8,1 k étoilesMIT
Voir le guide →
Image

UpscalerJS

Enhance images in JavaScript — upscale, denoise, deblur and dehaze with AI

★ 901 étoilesMIT
Voir le guide →
Image

MuseUI

Browser-only AI interface for UI mockups, covers, logos and social images

★ 56 étoilesMIT
Voir le guide →
// alternatives

Alternatives en Image

Les autres projets de la catégorie Image avec le plus d'étoiles du catalogue LibreAI — la sélection réaliste d'alternatives si SAM 2 ne vous convient pas.

// plus en image

Plus en Image

Projets de la catégorie Image proches dans le catalogue, les plus proches en étoiles de SAM 2 — continuez à explorer de part et d'autre.

Obtenir SAM 2

Gratuit et ouvert : récupérez le code source, mettez une étoile au dépôt et commencez à créer.