Giter VIP home page Giter VIP logo

vl-icl's Introduction

VL-ICL

[Webpage][Paper] [Data]

VL-ICL Bench: The Devil in the Details of Benchmarking Multimodal In-Context Learning.

Data Preparation

We host the our dataset at HuggingFace here.

git lfs install
git clone https://huggingface.co/datasets/ys-zong/VL-ICL
cd VL-ICL
bash unzip.sh
cd ..

Environment

Different conda environments may be needed for different models.

conda create -n {env_name} python==3.10 -y
pip install -r requirements/{model.txt}
conda activate {env_name}

Replace {model.txt} with corresponding file.

Most of the models can be automatically downloaded from Huggingface. For Text-to-image models (Emu1, Emu2, GILL, SEED-LLaMA), please see here for detailed instructions.

I2T

Inference

CUDA_VISIBLE_DEVICES=0 python I2T_inference.py --engine {model_name} --n_shot {shots} --dataset {dataset_name} --task_description detailed 

For example,

CUDA_VISIBLE_DEVICES=0 python I2T_inference.py --engine qwen-vl-chat --n_shot 0 1 2 4 5 --task_description detailed --dataset open_mi

Evaluation

python I2T_evaluate.py  --dataset {dataset_name} --engine {model_name} --n_shot {shots}

T2I

Inference

CUDA_VISIBLE_DEVICES=0 python T2I_inference.py --engine {model_name} --n_shot {shots} --dataset {dataset_name} --task_description detailed 

For example,

CUDA_VISIBLE_DEVICES=0 python T2I_inference.py --engine emu1-gen --n_shot 0 1 2 4 5 --task_description detailed --dataset open_t2i_mi

Evaluation

CUDA_VISIBLE_DEVICES=0 python T2I_evaluate.py --dataset open_t2i_mi  --engine seed-llama

Citation

@article{zong2024vlicl,
  title={VL-ICL Bench: The Devil in the Details of Benchmarking Multimodal In-Context Learning},
  author={Zong, Yongshuo and Bohdal, Ondrej and Hospedales, Timothy},
  journal={arXiv preprint arXiv:2403.13164},
  year={2024}
}

vl-icl's People

Contributors

ys-zong avatar

Stargazers

Cui Junbo avatar 千古兴亡知衡权 avatar WangLingfeng avatar Robin Ross avatar Isabel Rio-Torto avatar Zhang Jiahui avatar Yunze Man avatar Jeff Carpenter avatar Jo Pan avatar Yoon, Seungje avatar Vishaal Udandarao avatar Ondrej Bohdal avatar  avatar

Watchers

 avatar

vl-icl's Issues

how to use dataset

Good job, your work inspire me a lot.

Here is some little question about dataset.

  1. I don't see the train test split from dataset link.
  2. I don't know how to orgnize in contex sample from dataset. There seems is only sample one by one, not few shot.

Looking forward to get your responce!

about open_mi

Here is my prompt

Induce the concept from the in-context examples. Answer the question with a single word or phase.
We name this is a slation
We name this is a dax
Based on the in-context examples, we name this is a

gt: blicket

model: School bus

But if i change the last part of question to "Can you name this is a blicket or a dax?"
The Model will say "blicket".

I want to know is this prompt ok for VL-ICL benchmark?

LLaVA predictions are always empty

Thanks for the awesome paper and repo!

I was trying out LLaVA and noticed that the model predictions were always empty strings, and was able to narrow it down to this line

predicted_answers = tokenizer.batch_decode(generated_ids[:, input_token_len:], skip_special_tokens=True)[0]
.

It seems LLaVA already outputs only the tokens it generated, and not the whole context tokens + generated tokens.

The fix is quite easy, just decode the whole generated sentence, without truncating it first with the input_token_len.

Is my thinking correct or am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.