Papers › SAM 2: Segment Anything in Images and Videos
SAM 2: Segment Anything in Images and Videos
Nikhila Ravi, Valentin Gabeur, Yuan-Ting Hu, Ronghang Hu, Chaitanya Ryali, Tengyu Ma, Haitham Khedr, Roman Rädle, Chloe Rolland, Laura Gustafson, Eric Mintun, Junting Pan, Kalyan Vasudev Alwala, Nicolas Carion, Chao-yuan Wu, Ross Girshick, Piotr Dollár, Christoph Feichtenhofer
We present Segment Anything Model 2 (SAM 2), a foundation model towards solving promptable visual segmentation in images and videos. We build a data engine, which improves model and data via user interaction, to collect the largest video segmentation dataset to date. Our model is a simple transformer architecture with streaming memory for real-time video processing. SAM 2 trained on our data provides strong performance across a wide range of tasks. In video segmentation, we observe better accuracy, using 3x fewer interactions than prior approaches. In image segmentation, our model is more accurate and 6x faster than the Segment Anything Model (SAM). We believe that our data, model, and insights will serve as a significant milestone for video segmentation and related perception tasks. We are releasing our main model, dataset, as well as code for model training and our demo.
In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.
Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.
For agents, on Syntology's MCP service (how to connect):
get_harvested_code_for_paper(arxiv_id="2408.00714")get_code(code_sha256="…")with a sample'scode_sha256from the list belowget_citation_path(paper_1="2408.00714", paper_2="…")with another paper's arXiv id or titleget_concepts_for_paper(arxiv_id="2408.00714")
Code
Syntology 49 code samples harvested from 6 repositories linked to this paper: 40 ran (of which 9 constructed an object rather than computing a result; 29 with no instrument failure: 2 honoured, 0 violated, 27 with no contract checked; 11 where Syntology's instrument failed) · 9 unverified. Where Syntology's instrument failed: 11 where our contract draft was wrong; failures of Syntology's instrument, not of the code.
By repository: official repository: 5 samples from 1 repository, 3 ran (3 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 44 samples from 5 repositories, 37 ran (26 with no instrument failure; 11 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.
No sample is linked to this paper from 3 of its repositories that Syntology harvested for other papers:
- facebookresearch/segment-anything, community (archive-listed): harvested for another paper, listed under the repository
- yangchris11/samurai, community (archive-listed): harvested for another paper, listed under the repository
- MindCode-4/code-4, community (archive-listed): harvested for another paper, listed under the repository
Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 3 of the 40 samples that ran have no recorded date.
Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.
A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.
Code Syntology ran Syntology
49 samples harvested: 40 ran (of which 9 constructed an object rather than computing a result; 29 with no instrument failure: 2 honoured, 0 violated, 27 with no contract checked; 11 where Syntology's instrument failed) · 9 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.
Licence: 8 of the 49 samples are pointer only, meaning Syntology does not serve that copy's text. For 8 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.
Harvested from 6 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 1 sample that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.
Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.
Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.
A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.
census: 13 implementations from 12 papers, 10 distinct outputs across 4 buckets, one shared input per bucket sam2/modeling/sam2_base.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) ·
d505eb599e148d6a · report
fixture: returned Attention · level recorded 2026-09-22 57e7b89d7eb0f4a7 · report
fixture: returned PromptEncoder · level recorded 2026-09-22 f7f9295761cf41cf · report
fixture: returned TwoWayAttentionBlock · level recorded 2026-09-22 1337a6ec7dc01de3 · report
census: 10 implementations from 16 papers, 7 distinct outputs across 4 buckets, one shared input per bucket training/loss_fns.py ran Apache-2.0 (permissive) here; the stored copy is pointer only ·
e473e66fedc883c7 · report
fixture: signature inputs:Tensor/2/float, targets:Tensor/2/float, num_objects:int/0/int, loss_on_multimask:bool/0/bool · returned Tensor · level recorded 2026-09-25 d982bf60cc066b9a · report
fixture: signature preds:ndarray/2/int, targets:ndarray/2/int · returned float64 · level recorded 2026-09-24 78368949ab5a1fd4 · report
fixture: signature segmentation:ndarray/2/int · returned ndarray · level recorded 2026-09-24 a7768a633e703a5d · report
fixture: signature recist_per_lab:ndarray/2/float · returned ndarray · level recorded 2026-09-24 11b8b72a8eb095ec · report
fixture: signature recist_per_lab:ndarray/2/float, scale:int/0/int · returned ndarray · level recorded 2026-09-24 259650ecd92aae93 · report
fixture: signature mask:ndarray/2/int · returned dict · level recorded, date not recorded b8f501ca29e77f1a · report
fixture: signature inputs:Tensor/4/float, targets:Tensor/4/float, pred_ious:Tensor/2/float, num_objects:int/0/int, loss_on_multimask:bool/0/bool, use_l1_loss:bool/0/bool · returned Tensor · level recorded 2026-09-25 fecc11868aafba36 · report
fixture: signature path:str/0/str · returned tuple · level recorded, date not recorded 2e947f9cfdf99dc6 · report
fixture: signature per_obj_mask:dict/0/?, height:int/0/int, width:int/0/int · returned ndarray · level recorded, date not recorded 99b787e2d3339598 · report
fixture: signature array:ndarray/3/int, image_size:int/0/int · returned ndarray · level recorded 2026-09-24 621ef2b926968142 · report
fixture: signature bbox:ndarray/1/float, n:int/0/int · returned ndarray · level recorded 2026-09-24 census: 3 implementations from 9 papers, 2 distinct outputs across 2 buckets, one shared input per bucket training/loss_fns.py ran Apache-2.0 (permissive) here; the stored copy is pointer only ·
42fec6fdc1faf6f1 · report
fixture: signature inputs:Tensor/2/float, targets:Tensor/2/float, num_objects:int/0/int, alpha:float/0/float, gamma:float/0/float, loss_on_multimask:bool/0/bool · returned Tensor · level recorded 2026-09-25 a66342f2959074d2 · report
52aac67080d89311 · report
1191ad63c426c255 · report
census: 13 implementations from 12 papers, 10 distinct outputs across 4 buckets, one shared input per bucket sam2/modeling/sam2_base.py ran · metamorphic tier: deterministic Apache-2.0 (permissive) ·
d47d7ea80c6eb2e1 · report
fixture: returned Attention · level recorded 2026-09-22 b2caccbe8a2ad968 · report
fixture: returned MLP · level recorded 2026-09-22 2ec3b3adb254bc95 · report
fixture: returned MaskDecoder · level recorded 2026-09-22 2d44a88dd1788d01 · report
fixture: returned PositionEmbeddingRandom · level recorded 2026-09-22 0d0005d3af5adb47 · report
fixture: returned PromptEncoder · level recorded 2026-09-22 ea24008f11c4c7ec · report
fixture: returned TwoWayAttentionBlock · level recorded 2026-09-22 a6c3974188a5ffb0 · report
fixture: signature pos_inds:Tensor/1/int, dim:int/0/int, temperature:int/0/int · returned Tensor · level recorded 2026-09-22 4ee20f090e58c425 · report
fixture: signature frame_idx:int/0/int, cond_frame_outputs:dict/0/?, max_cond_frame_num:int/0/int · returned tuple · level recorded 2026-09-22 9a8c4da19cecdb81 · report
d5eb78117313126d · report
305742bafecf04f8 · report
fixture: signature epoch:int/0/int, warmup_epochs:int/0/int, total_epochs:int/0/int, ITERS_PER_EPOCH:int/0/int, base_keep_rate:float/0/float, max_keep_rate:float/0/float, iters:int/0/int · returned float · level recorded 2026-09-24 aa6da43d05cfaf65 · report
fixture: signature data:dict/0/? · returned list · level recorded 2026-09-24 e0a06ded5d4f6c3c · report
fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-22 40c655a7fe309e49 · report
fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-24 b48a27604b9574e0 · report
fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-24 3f82133185c8bcb4 · report
fixture: signature batch:list/1/tuple · returned tuple · level recorded 2026-09-24 f0de0cc660ea9823 · report
fixture: signature features:list/1/Tensor, strides:list/1/int · returned list · level recorded 2026-09-24 d8da96a9ed23308f · report
fixture: signature bbox_mask:Tensor/3/float, bbox:Tensor/2/float · returned Tensor · level recorded 2026-09-24 02f602286c531143 · report
fixture: signature bboxes:Tensor/3/float, patch_size:int/0/int, stride:int/0/int · returned list · level recorded 2026-09-24 90e571943800f79c · report
fixture: signature cfg:MockConfig/0/?, bs:int/0/int, device:device/0/?, gt_bbox:Tensor/2/float · returned Tensor · level recorded 2026-09-24 8ed1a71ee932713a · report
fixture: signature locations:Tensor/2/float, centers:Tensor/2/float, strides:Tensor/1/float, range:int/0/int · returned Tensor · level recorded 2026-09-24 2e6c35cccbde1c71 · report
fixture: signature inp_list:list/1/dict · returned tuple · level recorded 2026-09-24 c66db0b9eb9bb36a · report
fixture: signature inp_list:list/1/dict, return_search:bool/0/bool, return_template:bool/0/bool · returned dict · level recorded 2026-09-24 05992505df9ef0cd · report
fixture: signature input_dict:dict/0/?, average:bool/0/bool · returned dict · level recorded 2026-09-24 954460c5c93e5dfe · report
fixture: signature batch:list/1/dict · returned dict · level recorded 2026-09-24 8922173c3fa12488 · report
fixture: signature image:ndarray/3/int, mask:ndarray/2/int, color:tuple/1/int, alpha:float/0/float, draw_border:bool/0/bool · returned ndarray · level recorded 2026-09-24 23e01949c7f7b63f · report
fixture: signature image:ndarray/3/int, masks:dict/0/?, alpha:float/0/float, draw_border:bool/0/bool · returned ndarray · level recorded 2026-09-24 Method as code Syntology
What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.
3 assemblies on this paper: 3 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).
3 sibling assemblies for SAM 2 (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.
harvested Assembly for SAM 2 (graph method: SAM 2). 12 bricks; individually on a fixture: 9 ran (of which 7 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 2 where Syntology's instrument failed) · 3 unverified. The assembly has not been run end-to-end.
one of 3 siblings
- SAM2Base entry · level 0 · unverified ·
21359b77bae173ac - MLP helper · level 1 · ran ·
b2caccbe8a2ad968 - MaskDecoder helper · level 1 · ran ·
2ec3b3adb254bc95 - PromptEncoder helper · level 1 · ran ·
0d0005d3af5adb47 - TwoWayTransformer helper · level 0 · unverified ·
9a8c4da19cecdb81 - get_1d_sine_pe helper · level 1 · ran · our draft was wrong ·
a6c3974188a5ffb0 - select_closest_cond_frames helper · level 1 · ran · our draft was wrong ·
4ee20f090e58c425 - LayerNorm2d helper · level 1 · ran ·
b44d2d4c43f5956f - PositionEmbeddingRandom helper · level 1 · ran ·
2d44a88dd1788d01 - Attention helper · level 1 · ran ·
d47d7ea80c6eb2e1 - TwoWayAttentionBlock helper · level 1 · ran ·
ea24008f11c4c7ec - sdp_kernel_context helper · level 0 · unverified ·
d5eb78117313126d
harvested Assembly for SAM 2 (graph method: SAM 2). 11 bricks; individually on a fixture: 9 ran (of which 7 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.
one of 3 siblings
- SAM2Base entry · level 0 · unverified ·
e7f8982afcc2eeb8 - MLP helper · level 1 · ran ·
b2caccbe8a2ad968 - MaskDecoder helper · level 1 · ran ·
2ec3b3adb254bc95 - PromptEncoder helper · level 1 · ran ·
57e7b89d7eb0f4a7 - TwoWayTransformer helper · level 0 · unverified ·
1337a6ec7dc01de3 - get_1d_sine_pe helper · level 1 · ran · our draft was wrong ·
a6c3974188a5ffb0 - select_closest_cond_frames helper · level 1 · ran · our draft was wrong ·
4ee20f090e58c425 - LayerNorm2d helper · level 1 · ran ·
b44d2d4c43f5956f - PositionEmbeddingRandom helper · level 1 · ran ·
2d44a88dd1788d01 - Attention helper · level 1 · ran ·
d505eb599e148d6a - TwoWayAttentionBlock helper · level 1 · ran ·
f7f9295761cf41cf
harvested Assembly for SAM 2 (graph method: SAM 2). 11 bricks; individually on a fixture: 9 ran (of which 7 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 2 where Syntology's instrument failed) · 2 unverified. The assembly has not been run end-to-end.
one of 3 siblings
- SAM2Base entry · level 0 · unverified ·
784c0ac2dd86664c - MLP helper · level 1 · ran ·
b2caccbe8a2ad968 - MaskDecoder helper · level 1 · ran ·
2ec3b3adb254bc95 - PromptEncoder helper · level 1 · ran ·
57e7b89d7eb0f4a7 - TwoWayTransformer helper · level 0 · unverified ·
1337a6ec7dc01de3 - get_1d_sine_pe helper · level 1 · ran · our draft was wrong ·
a6c3974188a5ffb0 - select_closest_cond_frames helper · level 1 · ran · our draft was wrong ·
4ee20f090e58c425 - LayerNorm2d helper · level 1 · ran ·
b44d2d4c43f5956f - PositionEmbeddingRandom helper · level 1 · ran ·
2d44a88dd1788d01 - Attention helper · level 1 · ran ·
d505eb599e148d6a - TwoWayAttentionBlock helper · level 1 · ran ·
f7f9295761cf41cf
Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2408.00714") returns these assemblies with each brick's role and wiring (how to connect).
Tasks
Results from the paper archive 2025-07-28
| Task | Dataset | Model | Metric | Value | Rank at snapshot | Leaderboard | Report |
|---|---|---|---|---|---|---|---|
| Semi-Supervised Video Object Segmentation | DAVIS 2017 (val) | SAM2 | J&F | 90.7 | #1 of 81 | Archive leaderboard | report |
| Semi-Supervised Video Object Segmentation | DAVIS 2017 (val) | SAM2 | Params(M) | 224.4 | #1 of 81 | Archive leaderboard | report |
| Semi-Supervised Video Object Segmentation | MOSE | SAM2 | J&F | 77.9 | #1 of 17 | Archive leaderboard | report |
| Video Object Segmentation | M$^3$-VOS | SAM 2 | Average IOU | 69.5 | #4 of 4 | Archive leaderboard | report |
| Visual Object Tracking | DiDi | SAM2.1 | Tracking quality | 0.649 | #3 of 11 | Archive leaderboard | report |
| Visual Object Tracking | VOT2022 | SAM2.1 | EAO | 0.692 | #2 of 5 | Archive leaderboard | report |
Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.
Methods
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections