We study on the effect of in-context examples in computer vision. We propose a Prompt Retrieval framework to automatically select examples, consisting of an unsupervised (UnsupPR) and a supervised method (SupPR).
[01/2023] arXiv paper has been released.
[01/2023] The code for foureground segmentation has been released.
conda create -n XXX python=3.8
conda activate XXX
pip install -r requirements.txt
Our data preparation pipeline is based on visual prompt. Please follow the dataset preparation steps for PASCAL-5i dataset in this repository.
Click the Unsup/Sup stratedgy below to see the detailed instructions on how to run the code to reproduce the results.
Here, Random is the baseline method in visual prompt, SupPR and UnsupPR are shorted for supervised prompt retrieval and unsupervised prompt retrieval respectively.
The SupPR models for each pascal-5i split is uploaded in link.
If you use this code in your research, please kindly cite this work.
@inproceedings{zhang2023VisualPromptRetrieval,
title={What Makes Good Examples for Visual In-Context Learning?},
author={Yuanhan Zhang and Kaiyang Zhou and Ziwei Liu},
year={2023},
archivePrefix={arXiv},
}
Part of the code is borrowed from visual prompt, SupContrast, timm and mmcv.