Papers › VRP-SAM: SAM with Visual Reference Prompt

VRP-SAM: SAM with Visual Reference Prompt

27 Feb 2024CVPR 2024 1arXiv:2402.17726archive 2025-07-28

Yanpeng Sun, Jiahui Chen, Shan Zhang, Xinyu Zhang, Qiang Chen, Gang Zhang, Errui Ding, Jingdong Wang, Zechao Li

In this paper, we propose a novel Visual Reference Prompt (VRP) encoder that empowers the Segment Anything Model (SAM) to utilize annotated reference images as prompts for segmentation, creating the VRP-SAM model. In essence, VRP-SAM can utilize annotated reference images to comprehend specific objects and perform segmentation of specific objects in target image. It is note that the VRP encoder can support a variety of annotation formats for reference images, including point, box, scribble, and mask. VRP-SAM achieves a breakthrough within the SAM framework by extending its versatility and applicability while preserving SAM's inherent strengths, thus enhancing user-friendliness. To enhance the generalization ability of VRP-SAM, the VRP encoder adopts a meta-learning strategy. To validate the effectiveness of VRP-SAM, we conducted extensive empirical studies on the Pascal and COCO datasets. Remarkably, VRP-SAM achieved state-of-the-art performance in visual reference segmentation with minimal learnable parameters. Furthermore, VRP-SAM demonstrates strong generalization capabilities, allowing it to perform segmentation of unseen objects and enabling cross-domain segmentation. The source code and models will be available at https://github.com/syp2ysy/VRP-SAM

PaperPDFConference PDFCodeCode Syntology ranMethod as code

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):

Code

Syntology 38 code samples harvested from 1 repository linked to this paper: 25 ran (of which 4 constructed an object rather than computing a result; 6 with no instrument failure: 1 honoured, 1 violated, 4 with no contract checked; 19 where Syntology's instrument failed) · 13 unverified. Where Syntology's instrument failed: 14 where our contract draft was wrong; 5 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 38 samples from 1 repository, 25 ran (6 with no instrument failure; 19 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.

Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 2 of the 25 samples that ran have no recorded date.

syp2ysy/vrp-sam officialmentioned in papermentioned on GitHubpytorchMITSyntology: 38 samples, 25 ran (19 instrument-failed) · 13 unverified report

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.

Code Syntology ran Syntology

38 samples harvested: 25 ran (of which 4 constructed an object rather than computing a result; 6 with no instrument failure: 1 honoured, 1 violated, 4 with no contract checked; 19 where Syntology's instrument failed) · 13 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.

1ran · honoured contract
1ran · violated contract
14ran · our draft was wrong
5ran; the contract check could not run
4ran
13unverified

Licence: 7 of the 38 samples are pointer only, meaning Syntology does not serve that copy's text. For 7 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 syp2ysy/vrp-sam. “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 2 samples 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.

syp2ysy/vrp-sam official repository 38 samples, 25 ran (19 instrument-failed) · 13 unverified
CrossAttentionLayer in 10 papers model/VRP_encoder.py ran MIT (permissive) · 91b06471ea047993 · report fixture: returned CrossAttentionLayer · level recorded 2026-09-22
PositionEmbeddingSine in 21 papers
census: 6 implementations from 6 papers, 3 distinct outputs across 3 buckets, one shared input per bucket
model/VRP_encoder.py ran fingerprinted MIT (permissive) · 865b58f1322f66eb · report fixture: returned PositionEmbeddingSine · level recorded 2026-09-22
SelfAttentionLayer in 6 papers model/VRP_encoder.py ran MIT (permissive) · dd243c837e229569 · report fixture: returned SelfAttentionLayer · level recorded 2026-09-22
VGG in 16 papers model/VRP_encoder.py ran MIT (permissive) · 125a7d0d81f132b1 · report fixture: returned VGG · level recorded 2026-09-22
conv1x1 in 691 papers model/base/resnet.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · 2a80220dabcb742a · report fixture: signature in_planes:int/0/int, out_planes:int/0/int, stride:int/0/int · returned Conv2d · level recorded, date not recorded
conv3x3 in 1,376 papers model/base/resnet.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · 600ff2c45e0de056 · report fixture: signature in_planes:int/0/int, out_planes:int/0/int, stride:int/0/int, groups:int/0/int, dilation:int/0/int · returned Conv2d · level recorded, date not recorded
dice_loss in 193 papers
census: 10 implementations from 16 papers, 7 distinct outputs across 4 buckets, one shared input per bucket this sample: bucket 1 of 4, arg 1: rank 2, kind float, dtype float32 · arg 2: rank 2, kind float, dtype float32
model/VRP_encoder.py ran · our draft was wrong fingerprinted MIT (permissive) · d0e1858cb2c37a0a · report fixture: signature inputs:Tensor/2/float, targets:Tensor/2/float, num_masks:float/0/float · returned Tensor · level recorded 2026-09-22
draw_mask_by_control_points model/VRP_encoder.py ran · our draft was wrong MIT (permissive) · 90869aaabb17c767 · report fixture: signature mask:Image/0/?, Xs:list/1/int, Ys:list/1/int, brushWidth:int/0/int, fill:int/0/int · returned Image · level recorded 2026-09-22
get_bounding_boxes in 5 papers model/VRP_encoder.py ran · our draft was wrong fingerprinted MIT (permissive) · bec711098a9d7ac7 · report fixture: signature mask:Tensor/3/bool · returned tuple · level recorded 2026-09-22
get_gauss model/base/transformer_decoder.py ran · our draft was wrong MIT (permissive) · 8444605f6b41e659 · report fixture: signature mu:float/0/float, sigma:float/0/float · returned function · level recorded 2026-09-24
get_point_mask model/VRP_encoder.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · 17041ace285c82c0 · report fixture: signature mask:Tensor/3/float, training:bool/0/bool, max_points:int/0/int · returned Tensor · level recorded 2026-09-22
get_random_points_from_mask model/VRP_encoder.py ran · our draft was wrong fingerprinted MIT (permissive) · 5bd6ec912e92aa16 · report fixture: signature mask:Tensor/2/float, n:int/0/int · returned ndarray · level recorded 2026-09-22
get_random_stroke_control_points model/VRP_encoder.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · b34e7b2fb42c75da · report fixture: signature init_point:tuple/1/int, imageWidth:int/0/int, imageHeight:int/0/int, nVertexBound:tuple/1/int, maxHeadSpeed:int/0/int, maxHeadAcceleration:tuple/1/int, boarderGap:int/0/int, maxInitSpeed:int/0/int · returned tuple · level recorded 2026-09-22
get_random_velocity model/VRP_encoder.py ran · honoured contract MIT (permissive) · 1a515e2194aa7dde · report fixture: signature max_speed:float/0/float, dist:str/0/str · returned tuple · level recorded 2026-09-22
get_stroke_preset model/VRP_encoder.py ran · our draft was wrong MIT (permissive) · 999684f4c3a945e0 · report fixture: signature stroke_preset:str/0/str · returned dict · level recorded 2026-09-22
make_layers in 155 papers model/VRP_encoder.py ran · our draft was wrong MIT (permissive) · e31250b969b51841 · report fixture: signature cfg:list/1/int, batch_norm:bool/0/bool · returned Sequential · level recorded 2026-09-22
mean in 84 papers common/utils.py ran · violated contract fingerprinted MIT (permissive) · 2fbd545597570f15 · report fixture: signature x:list/1/float · returned float · level recorded 2026-09-24
random_accelerate model/VRP_encoder.py ran; the contract check could not run (RAISES) MIT (permissive) · d98f6e80e969ffbd · report fixture: signature velocity:tuple/1/float, maxAcceleration:tuple/1/float, dist:str/0/str · returned tuple · level recorded 2026-09-22
random_move_control_points model/VRP_encoder.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · 6ce193fee41d5329 · report fixture: signature Xs:ndarray/1/int, Ys:ndarray/1/int, lineVelocity:tuple/1/float, nMovePointRatio:float/0/float, maxPiontMove:int/0/int, maxLineAcceleration:tuple/1/float, boarderGap:int/0/int · returned tuple · level recorded 2026-09-22
to_cpu in 16 papers common/utils.py ran · our draft was wrong fingerprinted MIT (permissive) · a3d18d17a48bf937 · report fixture: signature tensor:Tensor/2/float · returned Tensor · level recorded 2026-09-24
to_cuda in 51 papers
census: 8 implementations from 8 papers, 2 distinct outputs across 2 buckets, one shared input per bucket
common/utils.py ran; the contract check could not run (RAISES) MIT (permissive) · 8c6947459806ae3b · report fixture: signature batch:dict/0/? · returned dict · level recorded 2026-09-24
vgg11 in 50 papers model/base/vgg.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · 2067e75510fbe85e · report fixture: signature pretrained:bool/0/bool · returned VGG · level recorded 2026-09-24
vgg11_bn in 40 papers model/base/vgg.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · bf96fb236a6b1683 · report fixture: signature pretrained:bool/0/bool · returned VGG · level recorded 2026-09-24
vgg16 in 21 papers model/VRP_encoder.py ran · our draft was wrong MIT (permissive) · bee97082c988542b · report fixture: signature pretrained:bool/0/bool · returned VGG · level recorded 2026-09-22
vgg16_bn in 9 papers model/VRP_encoder.py ran · our draft was wrong MIT (permissive) · af7ae822405c0966 · report fixture: signature pretrained:bool/0/bool · returned VGG · level recorded 2026-09-22
ResNet in 139 papers model/VRP_encoder.py unverified MIT (permissive) · f84316c0758d1988 · report
VRP_encoder model/VRP_encoder.py unverified MIT (permissive) · dccb2c6e0124c330 · report
build_sam_vit_b in 53 papers segment-anything/segment_anything/build_sam.py unverified MIT (permissive) here; the stored copy is pointer only · f9bc5f31ce61cee8 · report
build_sam_vit_h in 54 papers segment-anything/segment_anything/build_sam.py unverified MIT (permissive) here; the stored copy is pointer only · 6b77c1f11fff3ed6 · report
build_sam_vit_l in 53 papers segment-anything/segment_anything/build_sam.py unverified MIT (permissive) here; the stored copy is pointer only · 3f8890e695469246 · report
fix_bn model/VRP_encoder.py unverified MIT (permissive) · 95eec24a97f68828 · report
get_mask_by_input_strokes model/VRP_encoder.py unverified MIT (permissive) · b194906bc2cfe752 · report
get_scribble_mask model/VRP_encoder.py unverified MIT (permissive) · e7ce055d8adf68f5 · report
get_vgg16_layer in 7 papers model/VRP_encoder.py unverified MIT (permissive) · b43514b95d7af46c · report
resnet101 in 24 papers model/VRP_encoder.py unverified MIT (permissive) · e2f6e006a0c3cd9f · report
resnet18 in 432 papers model/base/resnet.py unverified MIT (permissive) · 05d0b3b6e54293c0 · report
resnet50 in 121 papers model/VRP_encoder.py unverified MIT (permissive) · 2eb5f791836669d0 · report
transformer_decoder model/VRP_encoder.py unverified MIT (permissive) · 99412e31d0dfed4d · report

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.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for VRP-SAM (graph method: VRP-SAM). 31 bricks; individually on a fixture: 22 ran (of which 6 constructed an object rather than computing a result; 7 with no instrument failure: 1 honoured, 0 violated, 6 with no contract checked; 15 where Syntology's instrument failed) · 9 unverified. The assembly has not been run end-to-end.

  1. VRP_encoder entry · level 0 · unverified · dccb2c6e0124c330
  2. dice_loss loss · level 1 · ran · our draft was wrong · d0e1858cb2c37a0a
  3. fix_bn helper · level 0 · unverified · 95eec24a97f68828
  4. get_bounding_boxes helper · level 1 · ran · our draft was wrong · bec711098a9d7ac7
  5. get_point_mask helper · level 1 · ran; the contract check could not run (RAISES) · 17041ace285c82c0
  6. get_scribble_mask helper · level 0 · unverified · e7ce055d8adf68f5
  7. get_vgg16_layer helper · level 0 · unverified · b43514b95d7af46c
  8. resnet101 helper · level 0 · unverified · e2f6e006a0c3cd9f
  9. resnet50 helper · level 0 · unverified · 2eb5f791836669d0
  10. transformer_decoder helper · level 0 · unverified · 99412e31d0dfed4d
  11. vgg16 helper · level 1 · ran · our draft was wrong · bee97082c988542b
  12. vgg16_bn helper · level 1 · ran · our draft was wrong · af7ae822405c0966
  13. get_mask_by_input_strokes helper · level 0 · unverified · b194906bc2cfe752
  14. get_random_points_from_mask helper · level 1 · ran · our draft was wrong · 5bd6ec912e92aa16
  15. get_stroke_preset helper · level 1 · ran · our draft was wrong · 999684f4c3a945e0
  16. Bottleneck helper · level 1 · ran · 6d8a817f41286a76
  17. ResNet helper · level 0 · unverified · f84316c0758d1988
  18. CrossAttentionLayer helper · level 1 · ran · 91b06471ea047993
  19. PositionEmbeddingSine helper · level 1 · ran · 865b58f1322f66eb
  20. SelfAttentionLayer helper · level 1 · ran · dd243c837e229569
  21. VGG helper · level 1 · ran · 125a7d0d81f132b1
  22. make_layers helper · level 1 · ran · our draft was wrong · e31250b969b51841
  23. draw_mask_by_control_points helper · level 1 · ran · our draft was wrong · 90869aaabb17c767
  24. get_random_stroke_control_points helper · level 1 · ran; the contract check could not run (RAISES) · b34e7b2fb42c75da
  25. random_move_control_points helper · level 1 · ran; the contract check could not run (RAISES) · 6ce193fee41d5329
  26. conv1x1 helper · level 1 · ran · our draft was wrong · 2a80220dabcb742a
  27. conv3x3 helper · level 1 · ran · our draft was wrong · 600ff2c45e0de056
  28. BasicBlock helper · level 1 · ran · d42ae3fd7fcd5024
  29. _get_activation_fn helper · level 1 · ran · our draft was wrong · 0bb264f52e707e08
  30. get_random_velocity helper · level 1 · ran · honoured contract · 1a515e2194aa7dde
  31. random_accelerate helper · level 1 · ran; the contract check could not run (RAISES) · d98f6e80e969ffbd

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="2402.17726") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Meta-LearningSegmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SAM

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