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 \textbf{point}, \textbf{box}, \textbf{scribble}, and \textbf{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 \url{https://github.com/syp2ysy/VRP-SAM}

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.17726")

Code

Syntology Ran 25 of 38 code samples harvested from 1 repository linked to this paper; 13 have no recorded run. Of those that ran: 1 ran · honoured contract; 10 ran · our draft was wrong; 4 ran · fixture could not drive it; 10 ran with no contract checked.

By repository: official repository: 38 samples from 1 repository, 25 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

syp2ysy/vrp-sam officialmentioned in papermentioned on GitHubpytorchMIT 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; 1 honoured the contract we drafted; 13 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
10ran · our draft was wrong
4ran · fixture could not drive it
10ran
13unverified

Licence: 0 of the 38 samples are pointer only, meaning Syntology does not serve that copy's text. 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. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (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 from a repository marked official are listed first. 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 four 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; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). 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.

CrossAttentionLayer syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran MIT (permissive) · 91b06471ea047993 · report
PositionEmbeddingSine syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran fingerprinted MIT (permissive) · 865b58f1322f66eb · report
SelfAttentionLayer syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran MIT (permissive) · dd243c837e229569 · report
VGG syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran MIT (permissive) · 125a7d0d81f132b1 · report
conv1x1 syp2ysy/vrp-sam/model/base/resnet.py official repository ran · our draft was wrong MIT (permissive) · 2a80220dabcb742a · report
conv3x3 syp2ysy/vrp-sam/model/base/resnet.py official repository ran · our draft was wrong MIT (permissive) · 600ff2c45e0de056 · report
dice_loss syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · d0e1858cb2c37a0a · report
draw_mask_by_control_points syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong MIT (permissive) · 90869aaabb17c767 · report
get_bounding_boxes syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · bec711098a9d7ac7 · report
get_gauss syp2ysy/vrp-sam/model/base/transformer_decoder.py official repository ran MIT (permissive) · 8444605f6b41e659 · report
get_point_mask syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 17041ace285c82c0 · report
get_random_points_from_mask syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 5bd6ec912e92aa16 · report
get_random_stroke_control_points syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · b34e7b2fb42c75da · report
get_random_velocity syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · honoured contract MIT (permissive) · 1a515e2194aa7dde · report
get_stroke_preset syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong MIT (permissive) · 999684f4c3a945e0 · report
make_layers syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong MIT (permissive) · e31250b969b51841 · report
mean syp2ysy/vrp-sam/common/utils.py official repository ran fingerprinted MIT (permissive) · 2fbd545597570f15 · report
random_accelerate syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · fixture could not drive it MIT (permissive) · d98f6e80e969ffbd · report
random_move_control_points syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 6ce193fee41d5329 · report
to_cpu syp2ysy/vrp-sam/common/utils.py official repository ran fingerprinted MIT (permissive) · a3d18d17a48bf937 · report
to_cuda syp2ysy/vrp-sam/common/utils.py official repository ran MIT (permissive) · 8c6947459806ae3b · report
vgg11 syp2ysy/vrp-sam/model/base/vgg.py official repository ran MIT (permissive) · 2067e75510fbe85e · report
vgg11_bn syp2ysy/vrp-sam/model/base/vgg.py official repository ran MIT (permissive) · bf96fb236a6b1683 · report
vgg16 syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong MIT (permissive) · bee97082c988542b · report
vgg16_bn syp2ysy/VRP-SAM/model/VRP_encoder.py official repository ran · our draft was wrong MIT (permissive) · af7ae822405c0966 · report
ResNet syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · f84316c0758d1988 · report
VRP_encoder syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · dccb2c6e0124c330 · report
build_sam_vit_b syp2ysy/vrp-sam/segment-anything/segment_anything/build_sam.py official repository unverified MIT (permissive) · f9bc5f31ce61cee8 · report
build_sam_vit_h syp2ysy/vrp-sam/segment-anything/segment_anything/build_sam.py official repository unverified MIT (permissive) · 6b77c1f11fff3ed6 · report
build_sam_vit_l syp2ysy/vrp-sam/segment-anything/segment_anything/build_sam.py official repository unverified MIT (permissive) · 3f8890e695469246 · report
fix_bn syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · 95eec24a97f68828 · report
get_mask_by_input_strokes syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · b194906bc2cfe752 · report
get_scribble_mask syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · e7ce055d8adf68f5 · report
get_vgg16_layer syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · b43514b95d7af46c · report
resnet101 syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · e2f6e006a0c3cd9f · report
resnet18 syp2ysy/vrp-sam/model/base/resnet.py official repository unverified MIT (permissive) · 05d0b3b6e54293c0 · report
resnet50 syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · 2eb5f791836669d0 · report
transformer_decoder syp2ysy/VRP-SAM/model/VRP_encoder.py official repository unverified MIT (permissive) · 99412e31d0dfed4d · report

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