--- pretty_name: SPEC task_categories: - image-to-text - text-to-image - image-classification tags: - image - text language: - en license: apache-2.0 size_categories: - 1K

## 🔧 Usage ### install ``` shell git clone https://github.com/wjpoom/SPEC.git cd SPEC/ pip install -e . ``` ### prepare data * run the following code in Python shell, replace `/path/to/save/data` with a specified dir to store the data. ```python import zipfile import os from huggingface_hub import hf_hub_download data_root = '/path/to/save/data' hf_hub_download(repo_id='wjpoom/SPEC', repo_type='dataset', filename='data.zip', local_dir=data_root) with zipfile.ZipFile(os.path.join(data_root, 'data.zip'), 'r') as zip_ref: zip_ref.extractall(os.path.join(data_root)) os.remove(os.path.join(data_root, 'data.zip')) ``` ### explore the dataset * We provide a 📓notebook that enables you to visually explore the test samples in the SPEC dataset. * Run this notebook either [locally](https://github.com/wjpoom/SPEC/blob/main/notebooks/explore_spec_local.ipynb) or online using [Colab](https://colab.research.google.com/github/wjpoom/SPEC/blob/main/notebooks/explore_spec_colab.ipynb). ### reproduce the results * In our paper, we evaluated four popular VLMs using our SPEC dataset, namely: CLIP, BLIP, FLAVA and CoCa. * To reproduce the results with these VLMs, you can run [this script](https://github.com/wjpoom/SPEC/blob/main/spec/run_eval.sh). * You can also reproduce with this [local notebook](https://github.com/wjpoom/SPEC/blob/main/notebooks/evaluate_example_local.ipynb) or the online [Colab notebook](https://colab.research.google.com/github/wjpoom/SPEC/blob/main/notebooks/evaluate_example_colab.ipynb). ### evaluate custom VLMs * If you want to evaluate your custom model on SPEC, you can follow the instructions in [this document](https://github.com/wjpoom/SPEC/blob/main/docs/evaluate_custom_model.md). * ## ✒️ Citation If you use our code or data in this repo or find our work helpful, please consider giving a citation: ``` @inproceedings{spec2024, title={Synthesize Diagnose and Optimize: Towards Fine-Grained Vision-Language Understanding}, author={Peng, Wujian and Xie, Sicheng and You, Zuyao and Lan, Shiyi and Wu, Zuxuan}, booktitle={CVPR}, year={2024} } ```