-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hyojin Bahng
committed
Jun 6, 2022
1 parent
a070fdb
commit e25c46c
Showing
8 changed files
with
968 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,59 @@ | ||
# visual_prompting | ||
# Exploring Visual Prompts for Adapting Large-Scale Models | ||
|
||
[[Paper]](https://arxiv.org/abs/2203.17274) [[Project Page]](https://hjbahng.github.io/visual_prompting/) | ||
|
||
## Overview | ||
We investigate the efficacy of visual prompting, a novel way of adapting pre-trained vision models to downstream tasks by only modifying the pixel space. You can find more details in our [paper](https://arxiv.org/abs/2203.17274). | ||
|
||
![](./figures/clip_vs_vision.png) | ||
|
||
|
||
## Installation | ||
Clone this repo: | ||
```bash | ||
git clone https://github.com/hjbahng/visual_prompting.git | ||
cd visual_prompting | ||
``` | ||
|
||
This code requires python 3+. Install dependencies by: | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
Prepare the pre-trained models: | ||
```bash | ||
bash models/download_models.sh | ||
``` | ||
|
||
## Training | ||
* Training for CLIP: | ||
```bash | ||
python main_clip.py --dataset cifar100 --root [path_to_cifar100] | ||
``` | ||
|
||
* Training for vision models: | ||
```bash | ||
python main_vision.py --model bit_m --dataset cifar100 --root [path_to_cifar100] | ||
``` | ||
## Testing | ||
* Testing for CLIP: | ||
```bash | ||
python main_clip.py --evaluate --resume /path/to/checkpoints/model_best.pth.tar --dataset cifar100 --root [path_to_cifar100] | ||
``` | ||
|
||
* Testing for vision models: | ||
```bash | ||
python main_vision.py --evaluate --resume /path/to/checkpoints/model_best.pth.tar --model bit_m --dataset cifar100 --root [path_to_cifar100] | ||
``` | ||
|
||
|
||
## Citation | ||
If you use this code for your research, please cite our paper. | ||
``` | ||
@article{bahng2022visual, | ||
title={Exploring Visual Prompts for Adapting Large-Scale Models}, | ||
author={Hyojin Bahng and Ali Jahanian and Swami Sankaranarayanan and Phillip Isola}, | ||
journal={arXiv preprint arXiv:2203.17274}, | ||
year={2022} | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.