File size: 24,933 Bytes
32b542e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# Prepare Data
* By default, all training data used for this repository will be searched in the directory `DATA_PATH`. Please specify or change your data location before code running as following:
```
export DATA_PATH='/mnt/lustre/share_data/zhujinguo/open_source_dataset'
```
* To make it very easy for you to run the training code, we provide [a toy dataset](https://drive.google.com/file/d/14GZPYqVLiXVYjxRGvC9WO4WK3WiwBPRY/view?usp=sharing), which is a small subset of our pretraing data.
You should download this and unzip this file to `DATA_PATH`.
With the data of this subset, you can train Uni-Perceiver with config file [configs/BERT_L12_H192_experiments/4tasks_training_small_datasets.yaml](../configs/BERT_L12_H192_experiments/4tasks_training_small_datasets.yaml).
Please refer to [pretraining.md](./pretraining.md) for training usage.
* For tasks with a fixed candidate target sets, such as image / video classification (where the target sets are the category labels) and masked language modeling (where the target set is the vocabulary), you also need to perpare the target set file. Please refer to the jupyter notebook [tools/generate_target_sets.ipynb](../tools/generate_target_sets.ipynb) for details.
* For the complete datasets for training our models, please download datasets according to the instructions below:
## Different datasets
### Todo List:
- [x] Imagenet-21k and Imagenet-1k
- [x] books&wiki
- [x] MSCOCO Caption
- [x] YFCC
- [x] CC12M
- [x] CC3M
- [x] Visual Genome
- [x] SBU
- [x] Kinetics-400 & Kinetics-700
- [x] Moments in Time
- [x] Flickr30k
- [x] MSVD
- [x] MSR-VTT
- [x] GLUE
- [x] VQA
### Imagenet-1k
1. Please download the images of imagenet dataset from the official website [Imagenet](https://image-net.org/).
2. We provide the annotation files (including train.txt, val.txt and test.txt) on [meta](https://drive.google.com/file/d/1piqII0qGHmK1pop0RjdoFx927hcm1Mny/view).
3. a) Tokenizing imagenet class names to generate "imagenet_class_name_CLIP_with_endoftext.pkl" using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb)
b) Or using generated file we provide from [here](https://drive.google.com/file/d/1bgFohNsppe7kksxTbWgSFMoEZuX0szc_/view?usp=sharing)
4. Organize them as follows:
```
DATA_PATH/
βββ imagenet/
βββ imagenet_class_name_CLIP_with_endoftext.pkl
βββ meta
βΒ Β βββ test.txt
βΒ Β βββ train.txt
βΒ Β βββ val.txt
βββ test
βΒ Β βββ ILSVRC2012_test_00000001.JPEG
βΒ Β βββ ILSVRC2012_test_00000002.JPEG
βΒ Β βββ ILSVRC2012_test_00000003.JPEG
βΒ Β βββ ILSVRC2012_test_00000004.JPEG
βΒ Β βββ ...
βββ train
βΒ Β βββ n01440764
β βΒ Β βββ n01440764_10026.JPEG
| βΒ Β βββ n01440764_10027.JPEG
| βΒ Β βββ n01440764_10029.JPEG
| βΒ Β βββ ...
βΒ Β βββ n01443537
| βΒ Β βββ ...
βΒ Β βββ n01484850
| βΒ Β βββ ...
| βββ ...
ββββ val
Β Β βββ ILSVRC2012_val_00000001.JPEG
Β Β βββ ILSVRC2012_val_00000002.JPEG
Β Β βββ ILSVRC2012_val_00000003.JPEG
Β Β βββ ...
```
### Imagenet-22k
1. Please refer to Imagenet-1K dataset.
2. Meta file is provided from [here](https://drive.google.com/file/d/1TDF0i8tXTB-K-zYOVhsmmocAtgrKpOG8/view?usp=sharing)
3. Imagenet class name file in [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb) for tokenizing is provided from [here](https://drive.google.com/file/d/1cJHD5Ysxfr4tRMqAAwjOah2glfFktiT1/view?usp=sharing). Or you can directly use the CLIP-tokenized imagenet-22K class name files is provided from [here](https://drive.google.com/file/d/1juSGVP8IjERXoM-AwxKRDtLk65p9FTds/view?usp=sharing)
### Books&wiki
1. please download files [wiki.doc](https://drive.google.com/file/d/1rZJ-Nj_SSqwu85tME3wbN8tfGhljfAsf/view) abd [bc1g.doc](https://drive.google.com/file/d/16T5EYqIjO-tAj1OFxz6bnnzEABCusCcv/view).
And put them together into a file:
```
cat wiki.doc bc1g.doc > bookswiki.doc
```
2. <a id="vocab"></a> a) Tokenizing vocabularies to generate "vocabulary_CLIP_with_endoftext.pkl" using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb)
b) Or using generated file we provide from [here](https://drive.google.com/file/d/1omEahjKjeWe0a4PSXEHaGE_WVdiZLf4W/view?usp=sharing)
3. Then put this files in `DATA_PATH`
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ bert_pretrain_data/
ββ bookswiki/
βββ bookswiki.doc
```
4. you can also download the plain text dataset from [huggingface.co/datasets/wikipedia](https://huggingface.co/datasets/wikipedia) and [huggingface.co/datasets/bookcorpus](https://huggingface.co/datasets/bookcorpus).
### MSCOCO
1. Please download the images of COCO 2014 from [MSCOCO](https://cocodataset.org/#download).
2. Download preprocessed coco captions from Karpathy's homepage: [link](http://cs.stanford.edu/people/karpathy/deepimagesent/caption_datasets.zip) and extract "dataset_coco.json" from zip file.
3. a) You can run the [coco_preprocess.py](./preprocess/coco_preprocess.py) file to split the dataset_coco.json file into train, val and test part:
1. walk into the /data/preprocess folder and open the [coco_preprocess.py](./preprocess/coco_preprocess.py) file;
2. fill the 'original_json' variable with the path you download the dataset_coco.json file.
3. fill the 'savepath' with the path you want to save the splited json file.
4. run the [coco_preprocess.py](./preprocess/coco_preprocess.py) file.
b) Or you can directly use the generated json file we provide from [here](https://drive.google.com/file/d/12XUh4-Lb82RXg7Sa-Vgtut2dhIqrp7Sy/view)
4. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
5. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ mscoco_dataset/
βββ new_annotations
β Β βββ captions_test5k.json
βΒ Β βββ captions_train113k.json
βΒ Β βββ captions_val5k.json
| βββ dataset_coco.json
βββ coco_origin
Β Β βββ train2014
β Β βββ COCO_train2014_000000000009.jpg
| βββ COCO_train2014_000000000025.jpg
| βββ COCO_train2014_000000000030.jpg
βΒ Β βββ ...
Β Β βββ val2014
βββ COCO_val2014_000000000042.jpg
βββ COCO_val2014_000000000073.jpg
βββ COCO_val2014_000000000074.jpg
Β Β βββ ...
```
### Visual Genome
1. Please download the images and region decriptions of visual genome from [VG](https://visualgenome.org/api/v0/api_home.html).
2. a) You can run the [region_descriptions.ipynb](./preprocess/region_descriptions.ipynb) to preprocess the downloaded "region_descriptions.json" file:
1. walk into the /data/preprocess folder and open the [region_descriptions.ipynb](./preprocess/region_descriptions.ipynb);
2. fill the path of downloaded 'region_descriptions.json' and the path you want to save the processed file.
3. run the [region_descriptions.ipynb](./preprocess/region_descriptions.ipynb).
b) Or you can directly use the generated json file we provide from [here](https://drive.google.com/file/d/1pnl30qAPr03RpKbdbH13YZI9GtWseEHf/view)
3. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
4. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ visual_genome/
βββ annotations
β Β βββ region_descriptions.json
βΒ Β βββ vg_captions_128filter.json
βββ images
Β Β βββ VG_100K
β Β βββ 2.jpg
| βββ 3.jpg
| βββ 4.jpg
βΒ Β βββ ...
Β Β βββ VG_100K_2
βββ 1.jpg
βββ 51.jpg
βββ 52.jpg
Β Β βββ ...
```
### Flickr30k
1. Please download the images of filckr30k according to the instruction of [Flickr30k](http://shannon.cs.illinois.edu/DenotationGraph/).
2. Download [flickr_jsons](https://drive.google.com/file/d/1_dJsD8_YXWtR0124X_RiEgcx1c6B_BUM/view) which provides the annotations of flickr30k images.
3. a) You can run the [process_flickr_caption_json.py](./preprocess/process_flickr_caption_json.py) to preprocess the json file:
1. walk into the /data/preprocess folder and open the [process_flickr_caption_json.py](./preprocess/process_flickr_caption_json.py);
2. fill the path of downloaded json files and fill the path you want to save the processed json files.
3. run the [process_flickr_caption_json.py](./preprocess/process_flickr_caption_json.py).
b) Or you can directly use the generated json files (including captions_test.json, captions_train.json and captions_val.json) we provide from [here](https://drive.google.com/file/d/1WIWUKbXfBJd1S0izTe_OuP7bjCFDk2wk/view)
4. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
5. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ flickr30k/
β βββ captions_test.json
β βββ captions_train.json
β βββ captions_val.json
βββ flickr30k_images
βββ flickr30k_images
βββ flickr30k_images
βββ 36979.jpg
βββ 65567.jpg
Β Β βββ ...
```
### SBU
1. Please download the SBU [url](https://drive.google.com/file/d/1Hfbw8DVSnE3ZAaWZ7C6d6hlUde7Pr_YN/view) and [caption](https://drive.google.com/file/d/1GY_kFyiFqOHAYvjfRdM98LMlAsnFmxic/view?usp=sharing) files.
2. Filling the path of above files in [sbu_download_list.py](./preprocess/sbu/sbu_download_list.py) and run it for generating the download_list.
3. Running the script [sbu_download.sh](./preprocess/sbu/sbu_download.sh) to download the sbu images.
4. a) You can run the [make_sbu_json.py](./preprocess/sbu/make_sbu_json.py) to get the annotation file:
b) Or you can directly download the generated json file [sbucaption.json](https://drive.google.com/file/d/1xFJPvyJNlH0jzqzHRN16Hk5DmKGiGEJE/view) we provide.
5. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
6. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ sbucaption/
βββ annotations
β βββ sbucaptions.json
βββ images
βββ 4385058960_b0f291553e.jpg
βββ 5148648301_1174ef59bc.jpg
βββ ...
```
### CC3M
1. Please download "Train_GCC-training.tsv" and "Validation_GCC-1.1.0-Validation.tsv" from [here](https://ai.google.com/research/ConceptualCaptions/download)
2. Filling the path of "Train_GCC-training.tsv" in [cc3m_train_download_list.py](./preprocess/cc3m/cc3m_train_download_list.py) and run it for generating the training download list.
3. Filling the path of "Validation_GCC-1.1.0-Validation.tsv" in [cc3m_val_download_list.py](./preprocess/cc3m/cc3m_val_download_list.py) and run it for generating the validation download list.
4. Running the script [cc3m_train_download.sh](./preprocess/cc3m/cc3m_train_download.sh) and [cc3m_val_download.sh](./preprocess/cc3m/cc3m_val_download.sh) to download the cc3m images.
5. Zip (without compression) "train_image", "val_image" by:
```
zip -0 ../train_image.zip ./*
zip -0 ../val_image.zip ./*
```
6. a) You can run the [make_cc3m_train_json.py](./preprocess/cc3m/make_cc3m_train_json.py) and [make_cc3m_val_json.py](./preprocess/cc3m/make_cc3m_val_json.py) to get the annotation file:
b) Or you can directly download the generated json files [train_spacy.json](https://drive.google.com/file/d/1_bqx0xQOQC3bd40GLMC27TyLRi1tHRlC/view) and [val_spacy.json](https://drive.google.com/file/d/11ibsX_K-hgdHiomk9c6JvuAl2kYW8tjt/view) we provide.
7. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
8. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ cc3m/
βββ train_spacy.json
βββ val_spacy.json
βββtrain_image
β Β βββ 00000000.jpg
βΒ Β βββ ...
Β Β βββ val_image
βββ 00000000.jpg
Β Β βββ ...
```
### CC12M
1. Please download "cc12m.tsv" from [here](https://github.com/google-research-datasets/conceptual-12m)
2. Filling the path of "cc12m.tsv" in [cc12m_train_download_list.py](./preprocess/cc12m/cc12m_train_download_list.py) and run it for generating the training download list.
3. Running the script [cc12m_train_download.sh](./preprocess/cc12m/cc12m_train_download.sh) to download the cc12m images.
5. Zip (without compression) "train_image" by:
```
zip -0 ../train_image.zip ./*
```
5. a) You can run the [make_cc12m_train_json.py](./preprocess/cc12m/make_cc12m_train_json.py) to get the annotation file:
b) Or you can directly download the generated json file [train_available.json](https://drive.google.com/file/d/1SVHmHpewvmpCbWDCsLSbwQ8lhusQXEIt/view) we provide.
6. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
7. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ c12m/
βββ train_available.json
βββ train_image
Β βββ 00000000.jpg
Β Β βββ ...
```
### Kinetics-400 & Kinetics-700
1. Please download the Kinectics-400 & Kinetics-700 videos according to the instructions of [this](https://github.com/cvdfoundation/kinetics-dataset)
2. a)
i. Filling the path of K400's "training" and "validation" folder you download in [k400_construct_csv.py](./preprocess/k400_construct_csv.py) and run it for generating the K400 related files (K400_val.csv, K400_train.csv, categories.txt, annotation.json).
ii. Filling the path of K700's "training" and "validation" folder you download in [k700_construct_csv.py](./preprocess/k700_construct_csv.py) and run it for generating the K700 related files (K700_val.csv, K700_train.csv, categories.txt, annotation.json).
iii. Running script [video_categories.ipynb](../tools/video_categories.ipynb) to generate "category_mapping.txt".
b) Or you can directly download the processed files we provide: [K400](https://drive.google.com/file/d/1YqchifEjoovZYJ77Egn5pHv3E1olRIpq/view?usp=sharing), [K700](https://drive.google.com/file/d/1fHdcBRdU27w7OfNijP0ZBsNbxLQSLfRa/view?usp=sharing)
3. a) Tokenizing K400, K700 class names to generate "k400_class_name_CLIP_with_endoftext.pkl" and "k700_class_name_CLIP_with_endoftext.pkl" using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb)
b) Or using generated file we provide from [K400-CLIP](https://drive.google.com/file/d/1V-SpRzugmFgHR6j7ifFLqh7Ao5VW-gM8/view?usp=sharing) and [K700-CLIP](https://drive.google.com/file/d/1lq9WaEWh1lmfBv4pOs8Aj9yTrTxkQc3Z/view?usp=sharing)
4. Organize the files into following structure:
```
DATA_PATH/
βββ k400_class_name_CLIP_with_endoftext.pkl
βββ K400/
Β βββ training
β βββ abseiling
β β βββ _4YTwq0-73Y_000044_000054.mp4
β β βββ ...
β βββ air_drumming
Β Β β βββ ...
βββ validation/
β βββ abseiling
β β βββ __NrybzYzUg.mkv
β β βββ ...
β βββ air_drumming
Β Β β βββ ...
βββ annotation.json
βββ category_mapping.txt
βββ categories.txt
βββ K400_train.csv
βββ K400_val.csv
```
K700 is similar.
### MomentsInTime
1. Please download the MomentsInTime videos according to the instructions of [Official Website](http://moments.csail.mit.edu/)
2. a)
i. Filling the path of "training" folder you download in [moments_construct_csv.py](./preprocess/moments_construct_csv.py) and run it for generating the training files (moments_train.csv, categories.txt, annotation.json).
ii. Running script [video_categories.ipynb](../tools/video_categories.ipynb) to generate "category_mapping.txt".
b) Or you can directly download the processed files we provide: [moments](https://drive.google.com/file/d/1aXVCBKrocatZfT8TRKv4TuxHkTa7SxMz/view?usp=sharing).
3. a) Tokenizing momentsInTime class names to generate "MiT_class_name_CLIP_with_endoftext.pkl" using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb)
b) Or using generated file we provide from [MiT-CLIP](https://drive.google.com/file/d/1xNC8Dld-0x735nO60cwUBYG3gTVvoPC8/view?usp=sharing)
4. Organize the files into following structure:
```
DATA_PATH/
βββ MiT_class_name_CLIP_with_endoftext.pkl
βββ MomentsInTime/
Β βββ training
β βββ adult+female+singing
β β βββ 0a2b81cb0ec5fde79b8c.mp4
β β βββ ...
β βββ adult+female+speaking
Β Β β βββ ...
βββ annotation.json
βββ categories.txt
βββ category_mapping.txt
βββ moments_train.csv
```
### MSVD
1. Download MSVD videos "YoutTubeClips.tar" from [here](https://www.cs.utexas.edu/users/ml/clamp/videoDescription/) and preprocessed "txt_labels" from [here](https://github.com/nasib-ullah/video-captioning-models-in-Pytorch/tree/main/MSVD/captions).
2. a) Fill the path of downloaded files in [msvd_preprocess.py](./preprocess/msvd_preprocess.py) to generate the annotation files (caption_msvd_train_cocostyle.json, caption_msvd_val_cocostyle.json, caption_msvd_test_cocostyle.json)
b) Or directly download the annotation files we provide [new_annotations](https://drive.google.com/file/d/1VHT8waNVp8LUFlfY_YACCbVrzBQW3sWy/view)
3. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
4. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ msvd_dataset/
Β βββ new_annotations
β βββ caption_msvd_test_cocostyle.json
β βββ caption_msvd_train_cocostyle
Β Β β βββ caption_msvd_val_cocostyle
βββ txt_labels
β βββ sents_test_lc_nopunc.txt
β βββ sents_train_lc_nopunc.txt
β βββ sents_train_lc_nopunc.txt
Β Β β βββ youtube_mapping.txt
βββ YouTubeClips
βββ _0nX-El-ySo_83_93.avi
Β Β βββ ...
```
### MSR-VTT
1. Download MSRVTT videos ("train_val_videos.zip", "test_videos.zip") and annotation files ("train_val_annotation.zip", "test_videodatainfo.zip") from [here](https://www.mediafire.com/folder/h14iarbs62e7p/shared) and download dataset split info from [here](https://github.com/ArrowLuo/CLIP4Clip/releases/download/v0.0/msrvtt_data.zip).
2. Unzip downloaded files above, fill the paths of "test_videodatainfo.json", "train_val_videodatainfo.json", "MSRVTT_train.9k.csv", "MSRVTT_JSFUSION_test.csv" in the [msrvtt_dataprocess_1k.ipynb](./preprocess/msrvtt_dataprocess_1k.ipynb)
b) Or directly download the annotation files ("caption_msrvtt_1k_trainval_cocostyle.json","caption_msrvtt_1k_test_cocostyle.json") we provide [annotations_new](https://drive.google.com/file/d/1ZnA4hEic6x9D7dfaEUPoa6MlQ30rITom/view)
3. Generating tokenized vocabularies as mentioned in [bookswiki part](#vocab)
4. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ msrvtt_dataset/
Β βββ annotations_new
β βββ caption_msrvtt_1k_trainval_cocostyle.json
Β Β β βββ caption_msrvtt_1k_test_cocostyle.json
βββ videos
βββ video0.mp4
Β Β βββ ...
```
### VQA
1. Download VQA meta data from the datalink [vilbert](https://github.com/jiasenlu/vilbert_beta/tree/master/data) provided, files including:
- dictionary.pkl
- train_ids.pkl
- val_ids.pkl
- train_target.pkl
- trainval_ans2label.pkl
- val_target.pkl
- trainval_label2ans.pkl
2. Download VG questions and answers from [here](https://drive.google.com/drive/folders/10XHRXg07lNbdZQrREhOLYVM3N0LrkTxB)
3. Download VQA annotations from the [link](https://visualqa.org/download.html) xmodaler provided, files including:
- vg_target.pkl
- VG_questions2.json
- download
- VG_annotations.json
4. Download VQA annotations from [VQA](https://visualqa.org/download.html) website, files including:
- v2_OpenEnded_mscoco_test2015_questions.json
- v2_OpenEnded_mscoco_train2014_questions.json
- v2_OpenEnded_mscoco_val2014_questions.json
5. a) Tokenizing all the possible answers using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb).
b) Or you can use the tokenized answers we provide [VQA_Answers](https://drive.google.com/file/d/1X-1blHh2MrYhDq9bkdndNVRZ-49VCsuz/view?usp=sharing).
6. Organize the files into following structure:
```
DATA_PATH/
βββ vocabulary_CLIP_with_endoftext.pkl
βββ mscoco_dataset/
| βββ coco_origin
| Β Β βββ train2014
| β Β βββ COCO_train2014_000000000009.jpg
| | βββ COCO_train2014_000000000025.jpg
| | βββ COCO_train2014_000000000030.jpg
| βΒ Β βββ ...
| Β Β βββ val2014
| βββ COCO_val2014_000000000042.jpg
| βββ COCO_val2014_000000000073.jpg
| βββ COCO_val2014_000000000074.jpg
| Β Β βββ ...
βββ VQA
βββ trainval_ans2label.pkl
βββ trainval_label2ans.pkl
βββ v2_OpenEnded_mscoco_train2014_questions.json
βββ v2_OpenEnded_mscoco_val2014_questions.json
βββ v2_OpenEnded_mscoco_test-dev2015_questions.json
βββ val_target.pkl
βββ VG_questions2.json
βββ vg_target.pkl
βββ coco_map.json
```
### GLUE
1. Follow the instructions of [this](https://github.com/nyu-mll/GLUE-baselines) to download GLUE benchmark data and refer to [fairseq](https://github.com/facebookresearch/fairseq/blob/main/examples/roberta/README.glue.md) to preprocess datasets.
2. a) Tokenizing GLUE datasets using [generate_target_sets.ipynb](../tools/generate_target_sets.ipynb).
b) Or you can use the tokenized answers we provide [GLUE_classnames](https://drive.google.com/file/d/1HR7xHsIRsS4iUwGr3CX6h5z_dVn-EJt-/view?usp=sharing).
3. Organize the files into following structure:
```
DATA_PATH/
βββ GLUE_classnames
βββ bert_pretrain_data/
Β βββ glue_data
βββ CoLA
βββ CoLA-bin
βββ diagnostic
βββ MNLI
βββ MNLI-bin
βββ MRPC
βββ MRPC-bin
βββ QNLI
βββ QNLI-bin
βββ QQP
βββ QQP-bin
βββ RTE
βββ RTE-bin
βββ SST-2
βββ SST-2-bin
βββ STS-B
βββ STS-B-bin
Β Β βββ WNLI
```
|